Search DaTutorials:  
HOME
ASP Tutorials
Introduction
Reference
   Building ASP Pages
   Built-in Objects
Tutorials

Generate random integers in a given range

Description:


How to generate random integers in a given range using ASP and VB Script.

Code:

<html> <body> <%
lowerbound = 450
upperbound = 700
Randomize()
Response.Write(Int((upperbound - lowerbound + 1) * Rnd + lowerbound))
%> </body> </html>

See working example:


Keywords:

ASP: Response.Write

VBScript: Rnd


     Internet Advertising | Advertising | Web Advertising | Online Advertising | Web Advertising
Home    Link To Us    Ad With Us    Contact Us    Tell A Friend    Affiliates    Blog    Stock Photos