-
Random coding
is there any oyher way in VB to generate a random number other than
Code:
dim intNum as integer
IntNum = (rnd*10)
this seems to give a less than random sequence even when compiled and I want to build a random generator into my RPG software
many thanks in advance
-
Re: Random coding
If you put the Randomize it makes your number truly random. If you don't it follows a set sequence.
Code:
dim intNum as integer
randomize
IntNum = (rnd*10)
Edit: Randomize only needs to be called once so put it in your form load. You don't want to call it more than once.
-
Re: Random coding
many thanks very helpfull but I have one question
do you need to call that in the module where the sub routines are or will the form load call do that as well? and does it need to be called in each form used?
-
Re: Random coding
It only needs to be called once per program execution.