History |
Randomize (math)
Purpose
Initializes the random number generator to seed new random numbers (Rnd calls).
If Randomize isn't used, the Rnd function will return the same list of random numbers every time it is run.
Syntax
Randomize [Seed]
Example
The following example demonstrates how Randomize can be used to create a new list of random numbers each time the program is run.
Sub Main ()
Dim i As Integer
Randomize
Print "Generating 25 random numbers from 1 to 100*
For i = 1 to 25
Print (100 * Rnd) + 1
Next i
End Sub
| ||||