RandSeed Variable
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;