Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function Random[(MaxValue: Integer)];
Returns a randomly generated number within a specified range.
If MaxValue is not specified Random returns a real number X where 0 <= x <1. If MaxValue is specified the X than falls between 0 and MaxValue.
To initialize the random number generator, call (once) the Randomize procedure.
Randomize;
Random; // results in a random number 0 <= x <1
Random(50); // results in a random number 0 <= x <50
|
Randomize, RandomRange, RandomFrom,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|