fdds_key - DDS definition value search


SYNOPSIS

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

integer function fdds_key(alias)

character*(*) alias

DESCRIPTION

The current input definition is scanned for tokens, delimited by white space. The function returns an integer key corresponding to a token that matches an alias name.

This function can be used to search definition values for keyword options and flags. It can also be used to count the number of tokens (array elements).

NOTE: It is preferred to use fdds_scank.

INPUT

An input definitions must already be selected. This is done by executing fdds_scanf.

Alias lists one or more names, delimited by white space. They are used to search the current input definition. The search begins at the first character in the value. The search stops at the first character of the first token that matches any alias.

If alias names are not specified, tokens are counted. Tokens in the definition value are delimited by white space.

OUTPUT

The return value is the index, starting from 1, of the token corresponding to an alias name. The token can be retrieved with fdds_scanf, to determine the actual alias matched. If no match is found, EOF is returned.

If alias names are not specified, the return value is the number of tokens found. This can be used to determine the array size required for a list of numbers. The current position is reset to the beginning of the value, after counting the tokens the value is ready to be retrieved by fdds_scanf.

EXAMPLE

      integer no_print, pick_count
      ...
      ! check "print_option" for keyword
      j = fdds_scanf('print_option', ' ')
      print_option = fdds_key('verbose VERBOSE long')
      
      ! count the number of trace picks
      j = fdds_scanf('trace_picks', ' ')
      pick_count = fdds_key(' ')
    

SEE ALSO

      fdds_scanf
      fdds_scanv
    

AUTHOR

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