Randomize Statement

Named Arguments

No

Syntax

Randomize [number]


number

Use: Optional

Data Type: Variant

Any valid numeric expression.

Description

Initializes the random number generator.

Rules at a Glance

  • Randomize uses number as a new seed value to initialize the random number generator used by the Rnd function. The seed value is an initial value that generates a sequence of pseudo-random numbers.

  • If you don't pass number to the Randomize statement, the value of the system timer is used as the new seed value.

  • Repeatedly passing the same number to Randomize doesn't cause Rnd to repeat the same sequence of random numbers.

Programming Tips and Gotchas

If you need to repeat a sequence of random numbers, you should call the Rnd function with a negative number as an argument immediately prior to using Randomize with any numeric argument.

See Also

Rnd Function
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.254.28