IBM Lotus Symphony


Randomize Statement [Runtime]

Initializes the random-number generator.

Syntax:

Randomize [Number]

Parameters:

Number: Any integer value that initializes the random-number generator. If Number is omitted, the generator uses the current value of the system timer.

Error Codes

5 Invalid procedure call

Example:

Sub ExampleRandomize

Dim iVar As Integer, sText As String

Dim iSpectral(10) As Integer

Randomize 2^14-1

For iCount = 1 To 1000

iVar = Int((10 * Rnd) ) REM Range from 0 to 9

iSpectral(iVar) = iSpectral(iVar) +1

Next iCount

sText = " | "

For iCount = 0 To 9

sText = sText & iSpectral(iCount) & " | "

Next iCount

MsgBox sText,0,"Spectral Distribution"

end sub


Product Feedback | Additional Documentation | Trademarks