N_TAGS

The N_TAGS function returns the number of structure tags contained in a structure expression. It optionally returns the size, in bytes, of the structure.

Calling Sequence

Result = N_TAGS( Expression )

Arguments

Expression

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 Expression is a structure containing nested structures, only the number of tags in the outermost structure are counted.

Keywords

LENGTH

Set this keyword to return the length of the structure, in bytes.

Example

Find the number of tags in the system variable !P and print the result by entering:

PRINT, N_TAGS(!P)

Find the length of !P, in bytes:

PRINT, N_TAGS(!P, /LENGTH)

See Also

CREATE_STRUCT , N_ELEMENTS , TAG_NAMES , Structures