March 2000
Intermediate to advanced
576 pages
18h 13m
English
RandSeed Variable
var RandSeed: LongInt;
RandSeed
contains the seed for the pseudorandom
number generator. If you do not call Randomize,
RandSeed starts at zero.
// Initialize RandSeed with a less predictable initial value. // This version incorporates the time of day, process ID, // and elapsed time since boot. It is unlikely that all three // will be the same from one run of the program to another. procedure MyRandomize; begin Randomize; // Start with the time of day. RandSeed := ((RandSeed shl 8) or GetCurrentProcessID) xor GetTickCount; end;
| Random Function, Randomize Procedure |
Read now
Unlock full access