fdds_scank - retrieve definition information from dictionary


SYNOPSIS

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

integer function fdds_scank(alias, keys)

character*(*) alias
character*(*) keys

DESCRIPTION

fdds_scank retrieves information about a definition in a dictionary. It is used to count definition tokens and search for keywords. The "scan" dictionary(s) must have been previously selected by fdds_dict, fddx_dict, or fddx_in.

ARGUMENTS

"alias" is used to set the "position" within the "scan" dictionaries from which value interrogation starts. It specifies the definition of interest. alias may contain multiple names, delimited by white space, or be blank. When names are given, the "scan" dictionaries are searched from bottom-to-top, right-to-left. The newest definition that matches any name is selected and the "position" is set imediately after the "=" of the definition. When alias is blank, the "position" is unchanged. values are interrogated starting at "position".

"keys" is a list of keywords to match against "tokens" available in value. It may be blank, it may be one of the DDS utility strings defined in fdds.h (e.g., DDS_TRUE_KEY), or it may be any other string useful to the application.

OUTPUT

When keys is blank, fdds_scank counts "tokens" between "position" and the end of the definition. If none are found, zero is returned. When "tokens" are counted, "position" does not change.

Keyword matching is requested with non-blank keys. Each "token" in value is compared to all of the keywords in keys. When a match is found, comparison stops and fdds_scank returns the "token" number within value that matched a keyword. ("token" numbering starts at 1.) The "position" is advanced to the "token". When a match is not found, the function returns zero and the "position" is not changed.

The function returns EOF when no definition is found for non-blank alias and when alias is blank and a definition is not yet selected.

EXAMPLES

 
c retrieve number of axes from dictionary associated with bin_tag
      ier = fddx_dict(bin_tag,'scan')
      rank = fdds_scank('axis',' ')

c retrieve the verbose flag from the par: dictionary
      ier = fdds_dict('par:','scan')
      verbose = .false.
      ier = fdds_scank('verbose',DDS_TRUE_KEY)
      if (ier .gt. 0) then
         verbose = .true.
      endif
    

SEE ALSO

fdds_dict  Select DDS dictionary and mode
fddx_dict  Select DDS dictionary and mode
fdds_scanf Retrieve a definition
    

AUTHOR

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