Complete VBScript Reference
The Rnd function returns a random number. The number is always less than 1 but greater or equal to 0.
| Parameter | Description |
|---|---|
| number | Optional. A valid numeric expression If number is:
|
A random number:
Note that you will get the same number every time. To avoid this, use the Randomize statement like in Example 2
The output of the code above will be:
To avoid getting the same number every time, like in Example 1, use the Randomize statement:
The output of the code above will be:
Here is how to produce random integers in a given range:
The output of the code above will be:
Complete VBScript Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|