^DECR

Decrement an argument in a complex path

 

WNSupported in Synergy .NET on Windows

 

 

^DECR(variable[, post_flag])

Arguments

variable

The argument to decrement.

post_flag

(optional) One of the following values:

true

Post-decrement. Decrement occurs after the surrounding functionality takes place.

any other value

Pre-decrement. Decrement occcurs before the surrounding functionality takes place. (default)

Discussion

If the data type for variable does not support decrement operations, a “No operator” error (NOOPER) occurs.

Examples

In the example below, the result on the second writeline is 17, meaning the decrement took place after the ToString().

main
record
    ivar, int
proc
    ivar = 18
    console.writeline(^decr(ivar).ToString())       ;Should be 17
    console.writeline(^decr(ivar,true).ToString())  ;Should be 17
    console.writeline(ivar)                         ;Should be 16