mumps.order()
Obtains the next value of the specified MUMPS global and subscripts.
Arguments
Argument | Data Type | Required | Description |
---|---|---|---|
globalName | string | Yes | The name of the global to examine |
subscripts | array | Yes | An array of subscripts. May be empty to examine the root node of the global. |
Return Value
mumps.order() returns a struct with the following members:
- value: A string representing the next value of the specified MUMPS global and optional subscripts.
- lastResult: A boolean value indicating whether or not the traversal of the specified global and optional subscripts has finished.
Example
This example returns a list of account names, presuming the IGLS accounting package is installed on the host.
CFScript
var mumps = new lib.cfmumps.Mumps(); mumps.open(); var lastResult = false; var nextSubscript = ""; writeOutput("<ul>"); while(!lastResult) { var order = mumps.order("TT", ["ACCT", nextSubscript]); lastResult = order.lastResult; nextSubscript = order.value; if(nextSubscript) { var accountName = mumps.get("TT", ["ACCT", nextSubscript]); writeOutput("<li>" & accountName & "</li>"); } } writeOutput("</ul>"); mumps.close();
CFML
<cfset mumps = new lib.cfmumps.Mumps()> <cfset mumps.open()> <ul> <cfset lastResult = false> <cfset nextSubscript = ""> <cfloop condition="lastResult EQ false"> Â <cfset order = mumps.order("TT", ["ACCT", nextSubscript])> Â <cfset lastResult = order.lastResult> Â <cfset nextSubscript = order.value> Â <cfoutput> Â Â <cfif nextSubscript NEQ ""> Â Â Â <li>#mumps.get("TT", ["ACCT", nextSubscript])#</li> Â Â </cfif> Â </cfoutput> </cfloop> </ul> <cfset mumps.close()>