ToBeReviewed/STRUCTURE/
where_tag.pro
Like WHERE but works on structure tag names
Obtain subscripts of elements in structure array for which
a particular Tag has values in a range or matching specified values.
Like the WHERE function but for use with structures
where_tag
Structure
result = where_tag(Struct, Nfound, TAG_NAME=TAG_NAME, TAG_NUMBER=TAG_NUMBER, ISELECT=ISELECT, NOPRINT=NOPRINT, RANGE=RANGE, VALUES=VALUES)
Return value
Nfound {out}
# of occurrences found.
Parameters
Struct
in
required
structure array to search.
Nfound
Keywords
TAG_NAME
Scalar string specifying Tag Name
TAG_NUMBER
Otherwise give the Tag Number,
ISELECT
Specifies indices to select only part of structure array,
(use it to recycle subscripts from previous searches).
NOPRINT
Suppress informational messages about nothing found.
RANGE
[min,max] range to search for in Struct
VALUES
One or array of numbers to match for in Struct,
Examples
Suppose STR is a structure with tags CAT_NO:indgen(10), and
NAME:strarr(10). Find the indices where STR.CAT_NO is
between 3 and 5.
IDL> print, WHERE_TAG( str, TAG_NAME = 'CAT_NO', VALUE = [3,4,5] ) ;or
IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5])
Version history
Version
$Id: where_tag.pro 163 2006-08-29 12:59:46Z navarro $
History
written 1990 Frank Varosi STX @ NASA/GSFC
Stop printing "Tag not found" with /NOPRINT, CD Pike 8-Jun-93
Known issues
Restrictions
User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2)
the VALUES or RANGE to search on;
Produced by IDLdoc 2.0.