Reference Guide > T Routines > TAG_NAMES Function
  

TAG_NAMES Function
Returns string array containing the names of tags in structure expression.
Usage
result = TAG_NAMES(expr)
Input Parameters
expr—The expression for which the tag names will be returned. Must be of structure type.
Returned Value
result—The string array containing the names of the tags. If expr is a structure containing nested structures, only the names of tags in the outermost structure are returned (as TAG_NAMES does not search for tags recursively).
Keywords
None.
Example
This example uses TAG_NAMES to display the tag names of a structure and one of its fields, which is also a structure.
; Create a structure containing four fields, the second of which
; is also a structure.
a = {struc1, t1: 0.0D, t2: {struct2, t2_t1: INTARR(3), $
   t2_t2: 0.0, t2_t3: 0L}, t3: FLTARR(12), t4: 0L}
; Display tag names of a.
PRINT, TAG_NAMES(a)
; PV-WAVE prints: T1 T2 T3 T4
; Display tag names of the structure in the second field of a.
PRINT, TAG_NAMES(a.t2)
; PV-WAVE prints: T2_T1 T2_T2 T2_T3
See Also
DELSTRUCT, N_TAGS, STRUCTREF

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.