If you want to generate a number between 4 and 10 you need to increase Max by 1…

of course. Modulus doesn't return the max itself :D … maybe someone should make this into a function and put it in the resources for b4gl. There should be a sources section :)

]]>Don't worry about it, lol. :)

When I first started using Basic4GL I used to always have problems generating Random Numbers.

The Basic4GL Help Documentation isn't much help either.

]]>If you want to generate a number between 4 and 10 you need to increase Max by 1…

` ``r = Rnd() % (11 - 4) + 4`

Which would become…

` ``r = Rnd() % (7) + 4`

` ``r = rnd() % ( max - min ) + min`

?

E.g. i want a random number between 4 and 10 then

` ``r = rnd() % ( 10 - 4 ) + 4 ' Which becomes r = rnd() % ( 6 ) + 4 ' Where rnd() % 6 gives a number between 0 and 6. ' Add +4 to that and you have a random number between ' 4 and 10`

` ``r = rnd() % max + min`

` ``number = rnd() % [big amount] + [small amoutt]`