Randomize Procedure


Randomize Procedure

Class

Microsoft.VisualBasic.VBMath

Syntax

     Randomize([number]) 


number (optional; Double)

A number used to initialize the random-number generator

Description

The Randomize procedure initializes the random-number generator with an optional "seed."

Usage at a Glance

  • Randomize uses number as a new seed value to initialize the pseudorandom-number generator used by the Rnd function. If you do not supply number, the value of the system timer will be used as the new seed value.

  • Repeatedly passing the same number to Randomize does not cause Rnd to repeat the same sequence of random numbers.

  • 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




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net