Randomize statement (LotusScript® Language)

Seeds (initializes) the random number generator.

Syntax

Randomize [ numExpr ]

Elements

numExpr

Any numeric expression. If you omit numExpr, Randomize uses the return value from Timer.

Usage

Use Randomize to seed the random number generator before calling Rnd to generate a number.

If you use Randomize with numExpr and then repeatedly call Rnd with no arguments, LotusScript® returns the same sequence of random numbers every time you run the script. To generate a different sequence of random numbers each time you run the script, do one of the following:

  • Use a variable numExpr to make sure that Randomize receives a different seed value every time the script is executed.
  • Use Randomize with no numExpr. This seeds the random number generator with the return value from Timer.

The particular sequence of random numbers generated from a given seed depends on the platform where you are running LotusScript®.

Example