set(3f) - [M_list::dictionary::OOPS] add or replace a key-value pair in a dictionary (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
type(dictionary) :: dict
character(len=*),intent(in) :: key character(len=*),intent(in) :: VALUEcall dict%rep(key,value)
Add or replace a key-value pair in a dictionary.
DICT is the dictionary. key key name VALUE value associated with key
Add or replace a key and value pair in a dictionary
program demo_set use M_list, only : dictionary implicit none type(dictionary) :: dict integer :: iResultscall dict%set(A,b) call dict%set(B,^) call dict%set(C, ) call dict%set(D,c) call dict%set(E,ZZ) call dict%set(F,ZZZZ) call dict%set(G,z) call dict%set(A,new value for A)
write(*,(*(a,"==>","[",a,"]",/))) & & (trim(dict%key(i)), & & dict%value(i)(:dict%count(i)), & & i=1,size(dict%key))
end program demo_set
> G==>[z] > F==>[ZZZZ] > E==>[ZZ] > D==>[c] > C==>[] > B==>[^] > A==>[new value for A]
John S. Urban
Public Domain
Nemo Release 3.1 | set (3) | February 23, 2025 |