mumps.increment()
Atomically increments a global node. If the global node is not defined, will set it to count, if specified, otherwise, sets the global node to 0.
Arguments
Argument | Data Type | Required | Description |
---|---|---|---|
globalName | string | Yes | The name of the global to examine |
subscripts | array | Yes | An array of subscripts |
count | numeric | No | The number by which to increment |
Return Value
Returns the incremented value.
Example
CFScript
var mumps = new lib.cfmumps.Mumps(); mumps.open(); // increments ^myCounter by 2 if it exists, otherwise, sets ^myCounter to 2. mumps.increment("myCounter", [], 2); mumps.close();
CFML
<cfset mumps = new lib.cfmumps.Mumps()> <cfset mumps.open()> <cfset mumps.increment("myCounter", [], 2); <cfset mumps.close()>