$Qlength()

Returns the number of subscripts in a variable name. The format is:

$QL[ENGTH] (namevalue)

Examples of $QLENGTH()

Example:

GTM>write $data(^|"XXX"|ABC(1,2,3,4))
0
GTM>set X=$name(^(5,6))

GTM>write $qlength(X)
5

The number of subscripts in x is 5. Notice that the name and the environment preceding it do not contribute to the count. Refer to $NAme() section earlier in this chapter for an understanding of the $NAME function.