M[UMPS] Functions - $QL[ENGTH]

Introduced in the 1995 ANSI M[UMPS] language standard.

This function returns information about the number of subscripts in a name-reference.

Assume that the following references are made in this order:

Reference   Value
$DATA(^|"XXX"|ABC(1,2,3,4))   0
SET X=$NAME(^(5,6))   X="^|""XXX""|ABC(1,2,3,5,6)"
$QLENGTH(X)   "5"

Note that this function only operates on the string that contains the name of a variable. The variable that is identified in this string is never accessed by this function. Therefore, this function only affects the naked indicator if the string in question is stored in a global variable.

For additional examples of this function, see the function $NAME.

This document is © Ed de Moel, 1995-2005.
It is part of a book by Ed de Moel that is published under the title "M[UMPS] by Example" (ISBN 0-918118-42-5).
Printed copies of the book are no longer available.