Integer expressions
An integer expression is an expression which results in an integer. It includes integer
literals, integer variables and integer operations. An integer number is made of digits (0
to 9), with a minus sign for negative values. Integers that are different from zero cannot
start with 0, so 01 and 007 are not valid. Floating-point numbers are not supported. An
integer variable is an integer-typed variable accessed with the INTEGER keyword.
The four basic arithmetic operations (addition, subtraction, multiplication and division)
are supported. They all require two integer operands.
ADD(operand1 TO operand2)
SUBTRACT(operand1 FROM operand2)
MULTIPLY(operand1 BY operand2)
DIVIDE(operand1 PER operand2)
Here are valid integer expressions:
0
-42
INTEGER (intVar) //where intVar is a previously-declared INTEGER variable.
ADD(5 to 10)
SUBTRACT(2 FROM 10)
MULTIPLY(INTEGER(intVar) BY 3)
DIVIDE(ADD(10 to 2) PER 4)
Only integer expressions can be assigned to variables with an integer type.