fdds_switch - Convenience Routine to return the logical value of a user switch


SYNOPSIS

#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)

integer function fdds_switch(switch, default)

character*(*) switch
integer default

DESCRIPTION

fdds_switch checks the command line (par:) for the value of a user logical switch specified by switch. Default is the default value when the switch is not explicitly specified.

RETURN VALUES

If the switch is given with no value, fdds_switch returns with a value of 1. If the value is any of these values ("1 y Y yes Yes YES t T true True TRUE") then the return value will be 1, else if the value is any of these values ("0 n N no No NO f F false False FALSE") then the return value will be 0. If the switch does not exist or if it does not have any of the above values, the return value then will be Default.

EXAMPLE

      logical :: l_verbose
      ...
      ! check for 'verbose=' on command line
      l_verbose = (fdds_switch('verbose',0).eq.1)
    

SEE ALSO

      fdds_scanf Retrieve definition
    

AUTHOR

R. L. Selzler, EPTG (May, 1994)