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.

<strong>Caché</strong> <strong>ObjectScript</strong> Functions$ORDERReturns the next local variable or the subscript of a local or global variable.$ORDER(variable,direction,target)$O(variable,direction,target)ParametersvariabledirectiontargetEither a local variable or a subscripted local or global variable. If anarray, the subscript is required. You cannot specify just the arrayname.Optional — The subscript order in which to traverse the target array.Values for subscripted variables can be: 1 = ascending subscriptorder (the default) or –1 = descending subscript order. Forunsubscripted local variables, 1 (the default) is the only permittedvalue.Optional — Returns the current data value of the next or previousnode of variable. Whether it is the next or previous depends on thesetting of direction. You must specify a direction value to specify atarget. For unsubscripted local variables, direction must be set to 1.If variable is undefined, the target value remains unchanged. Thetarget parameter cannot be used with structured system variables(SSVNs) such as ^$ROUTINE.DescriptionThe value $ORDER returns depends on the parameters used.• $ORDER(variable) returns the number of the next defined subscript if variable is asubscripted variable. The returned subscript is at the same level as that specified for thevariable. For example, $ORDER(^client(4,1,2) returns the next subscript (3), assumingthat ^client(4,1,3) exists.$ORDER(variable) returns the name of the next defined local variable in alphabeticcollating sequence, if variable is an unsubscripted local variable. For example, $ORDERwould return the following defined local variables in the following sequence: a, a0a, a1,a1a, aa, b, bb, c.• $ORDER(variable,direction) returns either the next or the previous subscript for thevariable. You can specify direction as 1 (next, the default) or –1 (previous).276 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!