i want to ask randomize is to use one time only in an application or can be used every time before using RND..
Printable View
i want to ask randomize is to use one time only in an application or can be used every time before using RND..
just once :wave:
ok i use it more that once ...
the what will happen ....?
theres no point, that i hear "Un-Randomizes" it by taking away its effects
If you use Randomize (Randomize Timer, whatever) once, and look at the pattern of random numbers generated over the course of the application's lifetime, then it will be a fairly even spread, because you have seeded the generator once only. If you then seed it again, then you are altering the distribution from that point on, so on a graph of the numbers generated over the app's lifetime you will two separate distributions. Eventually after many many Rnd calls you will end up with an even distribution again, but for every subsequent Randomize call you do change the random effect as |2eM!x said.
you only need it once to seed the random number generator. that results in rnd being as close to random as you can get.
The optional numberargument is aVariant or any validnumeric expression.
Quote:
Remarks
Randomize uses number to initialize the Rnd function's random-number generator, giving it a newseed value. If you omit number, the value returned by the system timer is used as the new seed value.
If Randomize is not used, the Rnd function (with no arguments) uses the same number as a seed the first time it is called, and thereafter uses the last generated number as a seed value.
Note To repeat sequences of random numbers, call Rnd with a negative argument immediately before using Randomize with a numeric argument. Using Randomize with the same value for number does not repeat the previous sequence.
but i have tried by using three time in one procedure .. but it is absolutely random ...
it isnt absolutely random, because it is impossible to be..
It is just a waste of processor time, and actually could make your data less random. Just call randomize once in your app, and it will be as random as it can be when you call RND, which you can do as many times as you want.
hmm ok thank you..