MOD
REM


The MOD and REM functions return the arithmetic modulo (remainder) of two numeric expressions.

 

COMMAND SYNTAX

MOD(expression1, expression2)
REM(expression1, expression2)

 

SYNTAX ELEMENTS

Both expression1 and expression2 should evaluate to numeric expressions or a runtime error will occur.

 

NOTES

The modulo is calculated as the remainder of expression1 divided by expression2. If expression2 evaluates to 0, then the value of expression1 is returned.

 

EXAMPLES

FOR I = 1 TO 10000
    IF MOD(I, 1000) = 0 THEN CRT "+":
NEXT I

displays a "+" on the screen every 1000 iterations.


jBC