^INCR

Increment an argument in a complex path

 

 

 

NSupported in Synergy .NET
^INCR(variable[, post_flag])

Arguments

variable

The argument to increment.

post_flag

(optional) One of the following values:

true

Post-increment. Increment occurs after the surrounding functionality takes place.

any other value

Pre-increment. Increment occcurs before the surrounding functionality takes place. (default)

Discussion

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

Examples

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

main
record
    ivar, int
proc
    ivar = 18
    console.writeline(^incr(ivar).ToString())       ;Should be 19
    console.writeline(^incr(ivar,true).ToString())  ;Should be 19
    console.writeline(ivar)                         ;Should be 20