[fpc-devel] I get duplicate GUIDs under Linux
graemeg.lists at gmail.com
Mon Jun 2 09:46:32 CEST 2008
On 31/05/2008, Vinzent Höfler <JeLlyFish.software at gmx.net> 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!
- Graeme -
fpGUI - a cross-platform Free Pascal GUI toolkit
More information about the fpc-devel