fdds_member - fetch a field_tag within a DDS structure


SYNOPSIS

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

integer fdds_member(bin_tag, structure_tag, field_name)

integer bin_tag
integer structure_tag
character field_name*(DEFNNAME_MAX)

DESCRIPTION

fdds_member returns the tag of a structure member in a DDS data stream. The name of the structure member is given by field_name, the structure is identified by the structure_tag for a given bin_tag. If structure_tag is zero, it defaults to the SEQUENCE (a trace) within bin_tag. If field_name is blank, the value returned will be the tag of the first member of the structure. field_name can include structure names relative to the structure_tag (eg. "Spare.Hdr.RecNum") or can specify the first member of a substructure (e.g. "TmMsS1_union."). The returned tag should be the field_tag used in fdds_index and fdds_get.

USP NOTE: if the field_name is "Horz..." and the member cannot be found, the "Horz" will be replaced with "TVPT" and tried again so that "Horz01" through "Horz20" can be overloaded and used in the fdds_getff and fdds_putff calls.

ARGUMENTS

"bin_tag" is the tag of an open binary, previously obtained from fddx_in. It specifies a binary stream.

"structure_tag" is the tag of a structure within bin_tag. A value of "0" (zero) always refers to an entire trace.

"field_name" is the name of the structure member to locate. If field_name is zero length or blank, the tag returned will be for the first member in the structure.

OUTPUT

The return value is the field_tag associated with the desired structure member or -1 if no member is found.

USP NOTE: if the field_name is "Horz...", the return value is the negative ( < -1) of the actual field_tag. This is a signal to fdds_getr, telling it to invoke fdds_getff with the absolute value of the field_tag.

EXAMPLE

c find index of header RecNum
      integer bin
      integer tag
      integer ndx,rec,ibuf(1)
      ...
      tag=fdds_member(bin,0,'RecNum')
      ndx=1+fdds_index(bin,tag,DDS_INTEGER)
      rec=ibuf(ndx)
      ...
    

SEE ALSO

fdds_index Query field index
fdds_get   Get a field
    

AUTHOR

Jerry Ehlers, BP America (May 2003)