Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(assoc_list_t), | intent(in) | :: | a | |||
character(len=*), | intent(in) | :: | key | |||
character(len=*), | intent(out) | :: | value | |||
integer, | intent(out) | :: | stat |
subroutine assoc_list_get_value_of_key(a,key,value,stat)
type(assoc_list_t), intent(in) :: a
character(len=*), intent(in) :: key
character(len=*), intent(out) :: value
integer, intent(out) :: stat
integer :: i
do i = 1, a%nitems
if (a%key(i) == key) then
value = a%value(i)
stat = 0
return
endif
enddo
stat = -1
end subroutine assoc_list_get_value_of_key