Graeme Geldenhuys schrieb:
On 31/05/2008, Vinzent Höfler <[EMAIL PROTECTED]> wrote:
Note that random() will always return the same sequence if you don't call
randomize() once in the program.
 Yes. But don't make the mistake to call it more than once.

Why can't FPC automatically call randomize() in the RTL. Put it in
some initialization section. That way, at application startup,
randomize() is already called and only Random() needs to be used?

I could never figure out why this wasn't done in Delphi either?  After
all, if you use Random(), you want something random, yet many
developers make the common mistakes of not calling Randomize() or
calling it to often.  If FPC handled that for us, nobody would every
make those mistakes again!

People might want to start with a defined randseed to reproduce behaviour.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to