Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?



The MOD or REM function returns the arithmetic modulo of two numeric expressions. It takes the general form: 

MOD(expression1, expression2)


REM(expression1, expression2)

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

Go back to jBASE BASIC

Was this article helpful?