VBScript Rnd Function
Complete VBScript Reference
The Rnd function returns a random number. The number is always less than 1
but greater or equal to 0.
Syntax
Parameter |
Description |
number |
Optional. A valid numeric expression If number is:
- <0 - Rnd returns the same number every time
- >0 - Rnd returns the next random number in the sequence
- =0 - Rnd returns the most recently generated number
- Not supplied - Rnd returns the next random number in the sequence
|
Example 1
document.write(Rnd)
Output:
0.7055475
|
Example 2
'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
|
Example 3
'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
Make your web applications look like a million bucks
|
|
Most web applications today use boring methods to present data to their viewers using grids or simple HTML tables. FusionCharts induces "life" into the web applications by converting monotonous data into lively charts, gauges & maps.
FusionCharts works with all technologies like ASP, ASP.NET, PHP, ColdFusion, Ruby on Rails, JSP, HTML pages etc.
and connects to any database to render animated & interactive charts. It takes less than 15 minutes and no expertise
whatsoever to build your first chart and just a glance of it to captivate your audience. This fact is endorsed by our
12,000 customers and 150,000 users which include a majority of the Fortune 500 companies.
And yeah, your applications could look like a million bucks by spending just $69.
So go ahead, download your
copy of FusionCharts and start "wow-ing" your customers now!
|
|