Syntax
Public Function MathRnd(Optional Number As Double) As Single
Description
This function is used to produce random numberless than 1 but greater than or equal to zero.
Parameters
Key | Description |
Number | An optional numeric value which determines howRnd methodgenerates a random numbe. |
Return value
Value | Return Result |
Less than zero | The same number every time , using number as the seed. |
Greater than zero | The next random number in the sequence. |
Equal to zero | The most recently generated number. |
Not supplied | The next random number in the sequence. |
Sample
Public Sub main()' Initialize the random number generator.Randomize AlertMessage MathRnd()*6+1 ' The result will be a random value of type double between 1 and 6 End Sub
See Also