14 lines
1.6 KiB
HTML
14 lines
1.6 KiB
HTML
<html><head><title>Command: Rand </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'> Rand ([low value],high value) </span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Generates a random integer value between the values specified.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>low value = optional - defaults to 1; lowest number to generate<br>
|
|
high value = highest number to generate<br></td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Unlike the <a href='RND.htm'>RND</a> command, this command actually returns only integer values. The low value defaults to 1 if no value is specified. The high value is the highest number that can be randomly generated.<br>
|
|
<br>
|
|
If you need to generate floating point random numbers, use <a href='Rnd.htm'>Rnd</a>.<br></td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Rand example<br>
|
|
<br>
|
|
; Set the randomizer seed for more true random numbers<br>
|
|
SeedRnd (MilliSecs())<br>
|
|
<br>
|
|
; Generate random numbers between 1 and 100<br>
|
|
For t = 1 To 20<br>
|
|
Print Rand(1,100)<br>
|
|
Next<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
|
|
</html>
|