assoc_list_get_value_by_index Subroutine

public subroutine assoc_list_get_value_by_index(a, i, value, stat)

Arguments

Type IntentOptional AttributesName
type(assoc_list_t), intent(in) :: a
integer, intent(in) :: i
character(len=*), intent(out) :: value
integer, intent(out) :: stat

Contents


Source Code

subroutine assoc_list_get_value_by_index(a,i,value,stat)
type(assoc_list_t), intent(in) :: a
integer, intent(in)            :: i
character(len=*), intent(out)     :: value
integer, intent(out)              :: stat

if (i <= a%nitems) then
   value = a%value(i) 
   stat = 0
else
   stat = -1
   value =""
endif

end subroutine assoc_list_get_value_by_index