11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$QLENGTH$QLENGTHReturns the number of subscripts in the specified local or global variable.$QLENGTH(namevalue)$QL(namevalue)ParametersnamevalueA string, or expression that evaluates to a string, which is a local orglobal reference.Description$QLENGTH returns the number of subscripts in a local variable, a process-private global,or a global specified by namevalue.ParametersnamevalueA string, or expression that evaluates to a string, which is a local or global reference. If thestring is a global reference, it can contain a namespace reference. It can have the formNAME(s 1 ,s 2 ,...,s n ).ExamplesThe following example show the results of $QLENGTH when used with subscripted andunsubscripted globals. The first $QLENGTH returns 0. The second $QLENGTH returns2.WRITE !,$QLENGTH("^|""USER""|%test")SET name="^|""USER""|%test(1,""customer"")"WRITE !,$QLENGTH(name)The following example returns the $QLENGTH value for a process-private global with twosubscript levels. The $ZREFERENCE special variable contains the name of the most recentlyreferenced variable.SET ^||myppg("food","fruit")="apples"WRITE !,$QLENGTH($ZREFERENCE) ; returns 2See Also• $QSUBSCRIPT function<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 287

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!