Klaus Hartnegg schreef:
a call to randomize "disrupts" the current state of the random
generator. That means that if you use random outside guid creation,
creating a guid can have unintended side effects on your random
generation.
Maybe the GUID generator should have an automatic call to randomize,
but use its own randseed (or preserve the original value):
randseed_old := randseed;
if not guid_rnd_initialized then begin
randomize;
guid_rnd_initialized := true;
end
else
randseed := guid_randseed;
result := rnd2guid(random);
guid_randseed := randseed;
randseed := randseed_old;
It is not that easy to restore the state of random number generator.
Vincent
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel