Classic ASP
Classic ASP
Generating Random Integer in Range
See more PRNG Examples
Demonstrates how to generate random integers in a specified range.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
success = 0
set fortuna = Server.CreateObject("Chilkat.Prng")
' Generate random integers between 12 and 24 inclusive
For i = 0 To 100
Response.Write "<pre>" & Server.HTMLEncode( fortuna.RandomInt(12,24)) & "</pre>"
Next
%>
</body>
</html>