Sfairadora

  • Reference Guide

Decrement

--x
x--
The parameter x is a variable or a data item of one of the types: Int, Int8, Int16, Int64, Byte, Word, Dword, Qword, or Date. The both versions of the operator decrement the value stored in the variable by one. The first version returns the decremented value as its result (predecrement); the latter version returns the original (not decremented) value (postdecrement).
If the result after decrement is less than the minimum value of the type, the result underflows, which is not considered an error.
The operator is an abbreviation for x = x - 1.
Example:
var Int x;
var Int y;
var Int z;
x = 10;
y = --x;
// coth x and y contain value 9
z = x--;
// x is 8, z is 9

See Also