fdoc

subroutineadd_entryprivate

subroutine add_entry(entries, key, value)

Set key in entries, replacing any entry it has.

Arguments

NameTypeIntentAttributesDescription
entriestype(map_entry_t)inoutallocatabledimension(:)

the map

keycharacter(len=*)in

the key

valuecharacter(len=*)in

its value

Source

Show the code
subroutine add_entry(entries, key, value)
    type(map_entry_t), allocatable, intent(inout) :: entries(:) !! the map
    character(len=*), intent(in) :: key                         !! the key
    character(len=*), intent(in) :: value                       !! its value
    integer :: k

    do k = 1, size(entries)
        if (entries(k)%key == key) then
            entries(k)%value = value
            return
        end if
    end do
    entries = [entries, map_entry_t(key, value)]
end subroutine add_entry

Graphs

Called by