I'd suggest setting randseed. IIRC, it's stack junk when the app starts up.
Setting it should give you a consistent sequence.

HTH,
Marshall

Sent from my Droid phone
On Jan 23, 2011 1:03 AM, "-K2RFP-" <rn...@verizon.net> wrote:
> Rory, yes I'm writing a program in Delphi 3 that is intended to
> run on all flavors of Windows, even on platforms that are running
> a Windows emulator.
>
> I will not be including a Randomize statement and I want to be
> able to produce the same list of random numbers regardless of the
> operating system. I thought that it would work as I want but I
> just wanted to make sure.
>
> Thanks for the reply.
>
> Dick, k2rfp
>
> On 1/22/2011 7:39 AM, Rory Daulton wrote:
>> -K2RFP-,
>>
>>> I have a program that uses the random number generator and
>>> there is no Randomize statement in it. From the help files
>>> this should produce the same sequence of random numbers
>>> every time the program runs.
>>>
>>> The question is, is the sequence the same for all operating
>>> systems that the program runs on?
>>
>> Are you talking about a Delphi program that uses Delphi's built-in
>> Random() function?
>>
>> If so, it will give the same sequence for any version of Windows that
>> it runs on. Random() does not use any Windows random number generator,
>> but uses its own, a linear congruential modulator. (At least, that is
>> so in the Delphi versions I have.) Even Randomize() would not depend
>> on the Windows version: it just uses the system time to set a random
>> number seed.
>>
>> Rory Daulton
>> rorydaul...@email.com
>>
>> __________________________________________________
>> Delphi-Talk mailing list -> Delphi-Talk@elists.org
>> http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk
>>
> __________________________________________________
> Delphi-Talk mailing list -> Delphi-Talk@elists.org
> http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> Delphi-Talk@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

Reply via email to