Returns an evaluated representation of some or all of a local or global variable name.
The format for the $NAME function is:
$NA[ME](glvn[,intexpr])
The subscripted or unsubscripted global or local variable name, including naked references, specifies the name for which $NAME() returns an evaluated representation.
When using NOUNDEF, $NAME() returns an empty string where appropriate for undefined variables.
The optional integer expression (second argument) specifies the maximum number of subscript levels in the representation. If the integer expression is not provided or exceeds the actual number of subscript levels, $NAME() returns a representation of the whole name. If the integer expression is zero (0), $NAME() returns only the name. A negative integer expression produces a run-time error.
Example:
GTM>set X="A""B",^Y(1,X,"B",4)="" GTM>write $name(^(3),3) ^Y(1,"A""B","B") GTM>
This example sets up a naked reference and then uses $NAME() to display the first three levels of that four-level reference.
Example:
GTM>write $name(^(3),0) ^Y GTM>
This example shows the name level for the same naked reference.