Name

RandSeed Variable

Syntax

var RandSeed: LongInt;

Description

RandSeed contains the seed for the pseudorandom number generator. If you do not call Randomize, RandSeed starts at zero.

Example

// 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;

See Also

Random Function, Randomize Procedure
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset