0% found this document useful (0 votes)
259 views1 page

MOD in T24

The MOD and REM functions return the remainder of dividing two numeric expressions. Both expressions must evaluate to numbers or a runtime error will occur. The modulo is the remainder of expression1 divided by expression2, and if expression2 is 0 then expression1 is returned. An example uses MOD to display "+" every 1000 iterations of a FOR loop by checking if the iteration number is evenly divisible by 1000.

Uploaded by

Emmanuel Tepoz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
259 views1 page

MOD in T24

The MOD and REM functions return the remainder of dividing two numeric expressions. Both expressions must evaluate to numbers or a runtime error will occur. The modulo is the remainder of expression1 divided by expression2, and if expression2 is 0 then expression1 is returned. An example uses MOD to display "+" every 1000 iterations of a FOR loop by checking if the iteration number is evenly divisible by 1000.

Uploaded by

Emmanuel Tepoz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

MOD in T24

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.

You might also like