lget(3f) - [ARGUMENTS:M_kracken] given keyword fetch logical array from command arguments (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
See Also
Author
License
function lgets(keyword) result(lvals)
character(len=*),intent(in) :: keyword logical,allocatable :: lvals(:)
The lgets(3f) function returns a dynamically allocated array of logical values from a string that is the value for a command line option. It is part of the M_kracken(3fm) module.Values that cannot be read as a logical value are returned as a ".FALSE.".
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.
lvals logical array 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".
Sample program:
program demo_lgets use M_kracken, only: kracken, lgets implicit none logical,allocatable :: vals(:) ! define command arguments and parse user command call kracken(’demo’,’-truths .F. .T. .F. .F. .T. .T.’ ) ! get any values specified on command line for -truth vals=lgets(’demo_truths’) write(*,*)vals end program demo_lgetsExample program runs:
$ demo_lgets
$ demo_lgets -truths false F .f. no true .true. t T Yes No
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 | lgets (3) | February 23, 2025 |