del(3f) - [M_list::dictionary::OOPS] delete entry by key name from a basic dictionary (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
type(dictionary) :: dict
character(len=*),intent(in) :: keydict%del(key)
Delete an entry from a basic dictionary if it is present.
DICT the dictionary. KEY the key name to find and delete from the dictionary.
Delete an entry from a dictionary by key name.
program demo_del use M_list, only : dictionary implicit none type(dictionary) :: caps integer :: i ! create a character string dictionary call caps%set(A,aye) call caps%set(B,bee) call caps%set(C,see) call caps%set(D,dee) ! show current dictionary write(*,101)(trim(caps%key(i)),trim(caps%value(i)),i=1,size(caps%key)) ! delete dictionary entries call caps%del(A) call caps%del(C) call caps%del(z) ! a noop as there is no key of z ! show current dictionary write(*,101)(trim(caps%key(i)),trim(caps%value(i)),i=1,size(caps%key))Results101 format (1x,*(a,"=",a,"",:,",")) end program demo_del
> D=dee,C=see,B=bee,A=aye > D=dee,B=bee
John S. Urban
Public Domain
Nemo Release 3.1 | del (3) | February 23, 2025 |