random

random(range: Integer): Integer;

The random method of the Application class returns a random positive number in the range 0 through the value of the range parameter, inclusive.

If the supplied range value exceeds 32,767, it is reset internally to 32,767. If the supplied range value is less than zero (0), it is internally reset to zero (0), which forces the random method to return to zero.

The code fragment in the following example shows the use of the random method.

rand := app.random(100); // get a random number between 0 and 100, inclusive

The sequence of generated random numbers is architecture-dependent.

See also the Application class random31 and seedRandom methods.