Name

Random — objTools.Random( )

Synopsis

This method returns a random integer between -32768 and 32767.

Example

<% 
' Generate a random integer between 0 and 100 using the Tools Component's
' Random function and the VBScript Mod function.
Dim objTools
Dim intRndm

Set objTools = Server.CreateObject("MSWC.Tools")
intRndm = (objTools.Random( ) Mod 101)
%>

Notes

The VBScript Rnd function is used more often than the Tools component's Random method, since Rnd is more flexible.

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.