FUNCTION: Rnd( )
The Rnd function generates a pseudo-random number
greater than or equal to
0.0 and less than 1.0.
The Number argument is optional, but different numbers
different pseudo-random numbers.
Note that the number generated is pseudo-random, because the
same output tends to
be repeated over and over. You can
use the Randomize statement to over
come this problem.
<% =Rnd() %>
<% =Rnd(127.89) %>
<% =Rnd(-127.89) %>
<% Randomize %>
The following code will generate a random number between any limits you choose.
(Since the Int function always rounds down, we add one to the difference between the limits.)
<% upperlimit = 50000.0 %>
<% lowerlimit = -30000.0 %>
<% =Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit) %>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.