N_TAGS function returns the number of
structure tags contained in a structure expression. It optionally returns the size, in bytes, of the structure.
Result = N_TAGS(
The expression for which the number of structure tags is to be returned. Expressions that are not of structure type are considered to have no tags. N_TAGS does not search for tags recursively, so if
is a structure containing nested structures, only the number of tags in the outermost structure are counted.
Set this keyword to return the length of the
structure, in bytes.
The length of a structure is machine dependent. The length of a given structure will vary depending upon the host machine. IDL pads and aligns structures in a manner consistent with the host machine's C compiler.
Find the number of tags in the system variable !P and print the result by entering:
Find the length of !P, in bytes:
PRINT, N_TAGS(!P, /LENGTH)