The MOD or REM function returns the arithmetic modulo of two numeric expressions. It takes the general form:
Where both expression1 and expression2 should evaluate to numeric expressions or a runtime error will occur.
The remainder of expression1 divided by expression2 calculates the modulo. If expression2 evaluates to 0, then the value of expression1 is returned.
An example of use is as below:
FOR I = 1 TO 10000 IF MOD (I, 1000) = 0 THEN *perform a task END NEXT I
Go back to jBASE BASIC