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?

RND

Description

The RND function allows the generation of random numbers by a program. It takes the general form:

RND(expression)

Where:

expression should evaluate to a numeric integer value or a runtime error will occur. The absolute value of expression is used by the function. The highest number expression can be on Windows is PWR(2,15) - 1. The highest number on UNIX is PWR(2,31) - 1.

The function will return a random integer number between 0 and the value of expression-1. 

An example of use is as:

FOR I=1 TO 20
    CRT RND (100):", ":
NEXT I

to print 20 random numbers in the inclusive range 0 to 99.


See also: ABS.

Go back to  jBASE BASIC.


Was this article helpful?