From http://www.w3schools.com (Copyright Refsnes Data)
Complete VBScript Reference
The Rnd function returns a random number. The number is always less than 1 but greater or equal to 0.
| Rnd[(number)] |
| Parameter | Description |
|---|---|
| number | Optional. A valid numeric expression If number is:
|
|
document.write(Rnd) Output: 0.7055475 |
|
'If you refresh the page, 'using the code in example 1, 'the SAME random number will show over and over. 'Use the Randomize statement generate a new random number 'each time the page is reloaded! Randomize document.write(Rnd) Output: 0.4758112 |
|
'Here is how to produce random integers in a 'given range: Dim max,min max=100 min=1 document.write(Int((max-min+1)*Rnd+min)) Output: 71 |
Complete VBScript Reference
From http://www.w3schools.com (Copyright Refsnes Data)