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.

$ORDER$ORDER Uses Naked Global <strong>Reference</strong>Like the $NAME and $QUERY functions, $ORDER can be used with a naked global reference,which is specified without the array name and designates the most recently executedglobal reference. For example:SET var1=^client(4,5)SET var2=$ORDER(^(""))WRITE "var1=",var1,!,"var2=",var2The first SET command establishes the current global reference, including the subscript levelfor the reference. The $ORDER function uses a naked global reference to return the firstsubscript for this level. For example, it might return the value 1, indicating ^client(4,1).For more details, see Naked Global <strong>Reference</strong> in Using <strong>Caché</strong> Multi-Dimensional Storage.$ORDER and $NEXT$ORDER is similar to $NEXT. Both functions return the subscripts of the next sibling incollating order to the specified node. However, $ORDER and $NEXT have different startand failure codes, as follows:Starting pointFailure code$NEXT-1-1$ORDERNull stringNull StringBecause $ORDER starts and fails on the null string, it correctly returns nodes having bothnegative and positive subscripts.See Also• $NEXT function• $QUERY function• $ZPREVIOUS function• Global Structure chapter in Using <strong>Caché</strong> Multi-Dimensional Storage<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 279

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

Saved successfully!

Ooh no, something went wrong!