Siebel VB Language Reference > VB Language Reference >
Timer Function
This standard VB function returns the number of seconds that have elapsed since midnight. Syntax
Timer
Returns
The number of seconds that have elapsed since midnight. Usage
The Timer function can be used in conjunction with the Randomize statement to seed the random number generator. Example
This example uses the Timer to find Megabucks numbers. Sub Button_Click Dim msgtext As String Dim value(9) As Single Dim nextvalue As Integer Dim x As Integer Dim y As Integer
msgtext = "Your Megabucks numbers are: " For x = 1 to 8 Do value(x) = Timer value(x) = value(x) * 100 value(x) = Str(value(x)) value(x) = Val(Right(value(x),2)) Loop Until value(x)>1 and value(x)<36 For y = 1 to 1500 Next y Next x
For y = 1 to 8 For x = 1 to 8 If y <> x then If value(y) = value(x) then value(x) = value(x) + 1 End If End If Next x Next y For x = 1 to 8 msgtext = msgtext & value(x) & " " Next x End Sub
Related Topics
Randomize Statement
|