[UP]


Manual Reference Pages  - lget (3)

NAME

lget(3f) - [ARGUMENTS:M_kracken] given keyword fetch logical value from command arguments (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Example
See Also
Author
License

SYNOPSIS

function lget(keyword) result(lval)

    character(len=*),intent(in)  :: keyword
    logical                      :: lval

DESCRIPTION

The lget(3f) function returns a scalar logical value from a command line argument using the M_kracken(3fm) module.

OPTIONS

keyword
  the dictionary keyword (in form VERB_KEYWORD) to retrieve. The VERB name comes from the first argument of the KRACKEN(3f) call. The KEYWORD is a keyword from the second argument to the KRACKEN(3f) call.

RETURNS

lval logical value returned by function. The input value should be from the case-insensitive list of the words "true, false, t, f, yes, no, y, n, .false., .true., .f., .t.,’’". .TRUE. is returned if the corresponding string in the dictionary for KEYWORD is blank.

EXAMPLE

Sample program:

   program demo_lget
   use M_kracken, only: kracken, lget
   implicit none
   logical  :: val
     ! define command arguments and parse user command
     call kracken(’demo’,’-truth .F.’ )
     ! get any values specified on command line for -truth
     val=lget(’demo_truth’)
     write(*,’("The truth is ",l1)’)val
   end program demo_lget

Example program runs:

     $ demo_lget             # uses the default
     The truth is F
     $ demo_lget -truth      # A BLANK VALUE IS TRUE
     The truth is T
     $ demo_lget -truth yes  # Y, yes, T, true, .T., .true. are all true
     The truth is T
     $ demo_lget -truth F    # N, no, F, false, .F., .FALSE. are all false
     The truth is F

SEE ALSO

M_kracken(3f),
  kracken(3f)
dget(3f), dgets(3f), iget(3f), igets(3f), lget(3f), lgets(3f), rget(3f), rgets(3f), sget(3f), sgets(3f), retrev(3f)

parse(3f), dissect(3f), store(3f), setprompts(3f), show(3f)

AUTHOR

John S. Urban

LICENSE

Public Domain


lget (3) October 17, 2020
Generated by manServer 1.08 from ad59a266-0acb-46eb-961f-9eab7970a590 using man macros.