Random

The Random method returns an integer between –32768 and 32767. This method is similar to the Rnd function but returns an integer. To get a positive random integer, use the Abs function. To get a random integer below a specific value, use the Mod function.

Syntax

oTools.Random

Example

--- Tools_Random.asp ---

<%
Set oTools = Server.CreateObject("MSWC.Tools")
%>

<H3>Generating Unique Customer Passwords</H3>

<P>Between -32768 and 32767:
<B><%= oTools.Random %></B>
<P>Between 0 and 32767:
<B><%= (Abs(oTools.Random)) %></B>
<P>Between 0 an 99:
<B><%= (Abs(oTools.Random)) Mod 100 %></B>
 
See Also

FileExists, ProcessForm


© 1997-2001 Microsoft Corporation. All rights reserved.