
Randomize Procedure | 415
The Language
Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Else
level = 1000
End If
End If
Console.WriteLine(level)
End Function
End Class
Module GeneralCode
' ----- Declare the object that has an event.
Public WithEvents workObject As New Transact
Public Sub Main
workObject.UpdateRecords(1100)
End Sub
Private Sub CheckForProblem(ByVal problemPrompt As String, _
ByRef cancelNow As Boolean) Handles workObject.Status
If (MsgBoxResult.Yes = MsgBox(problemPrompt, _
MsgBoxStyle.YesNo Or MsgBoxStyle.Question)) Then _
cancelNow = True
End Sub
End Module
Version Differences
Visual Basic 2005 includes a new Custom Event declaration that provides for additional
management of event-related activities.
See Also
Event Statement
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.