RANDOMIZE

RANDOMIZE

Top  Previous  Next

 

The RANDOMIZE statement initialises the random number generator.

 

 

Format

 

RANDOMIZE expr

 

where

 

exprevaluates to a number. If omitted or a null string, the time of day is used.

 

 

The RANDOMIZE statement initialises the seed value of the random number generator function, RND(). Supplying the same seed value in successive uses of this statement guarantees that the same pseudo-random number sequence is generated. Note that the sequence returned may vary between QM releases or on different platforms even if the same seed value is set.

 

If the expr value is omitted or given as a null string, the time of day is used thus giving a reasonable chance of a different pseudo-random sequence on successive executions of the program.

 

 

See also:

RND()