Operator -- Foundation
Decrement operator (unary): subtracts one from a numeric or date value.
--<VarName> // Prefix decrementing
<VarName>-- // Postfix decrementing
The decrement operator is a unary operator which reduces the value of its operand by one. It subtracts the value 1 from the value of the variable <VarName> and then assigns the result to the variable <VarName>.
In evaluating an expression in which <VarName> is used, the position of the decrement operator determines when the decrementing occurs. When the decrement operator precedes the variable <VarName>(prefix notation), the value of the variable is first decremented and then the expression is evaluated. When the decrement operator follows the variable (postfix notation), the expression is first evaluated with the current value of the variable and then the value is decremented.
The variable <VarName> must contain a numeric or a date value at the time it is decremented. When it is not declared as LOCAL or STATIC or does not exist at the compile time, it is considered to be of storage class MEMVAR unless an explicit alias is used or it is declared as a field variable in a FIELD statement.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.