Rnd function

Returns a random numeric integer. You can use the InitRnd statement to initialize the Rnd function.

random = Rnd(expression)

The Rnd function has the following parameters.

ParameterDescription
ExpressionAny legal BASIC+ expression.




The Rnd function returns a random number that is from 0 (zero) to the designated number. For example, in

N = Rnd(500)

the variable identifier N will be assigned a random number from 0 to 500. Note that 0 (zero) is a possible number in the random selection.

An expression designating null or (0) returns a (0). A negative expression returns a negative random number.|

/* Assigns a number between 0 and 100. */

random_num = Rnd(100)
 
**
**
  • guides/programming/programmers_reference_manual/rnd.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1