lget(3f) - [ARGUMENTS:M_kracken] given keyword fetch logical value from command argument (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
See Also
Author
License
function lget(keyword) result(lval)
character(len=*),intent(in) :: keyword logical :: lval
The lget(3f) function returns a scalar logical value from a command line argument using the M_kracken(3fm) module.
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.
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. [char46]FALSE. is returned if a string not in the list is found.
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_lgetExample 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
dget(3f), dgets(3f), iget(3f), igets(3f), lget(3f), lgets(3f), rget(3f), rgets(3f), sget(3f), sgets(3f), retrev(3f)
M_kracken(3f), kracken(3f) parse(3f), dissect(3f), store(3f), setprompts(3f), show(3f)
John S. Urban
Public Domain
Nemo Release 3.1 | lget (3) | February 23, 2025 |