Syntax |
Random(min,max) |
Description |
Returns a Long value greater than or equal to min and less than or equal to max. |
Comments |
Both the min and max parameters are rounded to Long. A runtime error is generated if min is greater than max. |
Example |
This example sets the randomize seed then generates six random numbers between 1 and 54 for the lottery. Const crlf = Chr$(13) + Chr$(10) Sub Main() For x = 0 To 5 'Elimininate duplicate
numbers. If found = false Then
a(x) = temp Else x = x - 1 ArraySort a MsgBox "Today's winning lottery
numbers are: " & crlf & crlf & msg1 |
See Also |
R |