Returns a random integer from a specified range.
function RandomRange(const AFrom: Integer; const ATo: Integer): Integer;
int RandomRange(const int AFrom, const int ATo);
RandomRange returns a random integer from the range that extends between AFrom and ATo (non-inclusive). RandomRange can handle negative ranges (where AFrom is greater than ATo).
To initialize the random number generator, add a single call Randomize or assign a value to the RandSeed variable before making any calls to RandomRange.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|