C Library Functions  - ifdef (3)

NAME

ifdef(3f) - [M_list::dictionary::OOPS] return whether name is present in dictionary or not (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

type(dictionary) :: dict

   character(len=*),intent(in) :: key
   logical :: value

value=dict%ifdef(key)

DESCRIPTION

determine if name is already defined in dictionary or not

OPTIONS

DICT is the dictionary.
KEY key name

RETURNS

VALUE [char46]FALSE. if name not defined, .TRUE if name is defined.

EXAMPLES

Sample program:

    program demo_ifdef
    use M_list, only : dictionary
    implicit none
    type(dictionary)             :: table
    character(len=:),allocatable :: val
    integer                      :: i

call table%set(’A’,’value for A’) call table%set(’B’,’value for B’) call table%set(’C’,’value for C’) call table%set(’D’,’value for D’) call table%set(’E’,’value for E’) call table%set(’F’,’value for F’) call table%set(’G’,’value for G’) call table%del(’F’) call table%del(’D’)

write(*,*)’A=’,table%ifdef(’A’) write(*,*)’B=’,table%ifdef(’B’) write(*,*)’C=’,table%ifdef(’C’) write(*,*)’D=’,table%ifdef(’D’) write(*,*)’E=’,table%ifdef(’E’) write(*,*)’F=’,table%ifdef(’F’) write(*,*)’G=’,table%ifdef(’G’) write(*,*)’H=’,table%ifdef(’H’)

end program demo_ifdef

Results:

    > A= T
    > B= T
    > C= T
    > D= F
    > E= T
    > F= F
    > G= T
    > H= F

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 ifdef (3) July 22, 2023
Generated by manServer 1.08 from 79e76892-3e4f-40bc-9c13-44034d6b8e6c using man macros.