Random Number

  • Thread starter Thread starter Tony C
  • Start date Start date
T

Tony C

I am using a line of code, to randomly pick out a number
from a known range

draw_no = Int(draw_value * Rnd)

draw_value is the count of the numbers to be drawn. In
this case it's 22.

draw_no is 'the winning number'

Trouble is, it's not random. It returns the same run of
values every time I use it.

Not really random. Any ideas please
 
Read about
rondomize
in the help file.

This initializes the generator...
 
You might note that 22 would never get selected. Assuming you don't have a
zero but have 22 entrants:

Draw_Value = 22
draw_no = Int(draw_value * Rnd + 1)

or

draw_no = Int(draw_value*Rand) + 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top