View Single Post
Old February 14th, 2005, 10:14 AM
shattered shattered is offline
Authorized User
Join Date: Oct 2004
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shattered Send a message via Yahoo to shattered

ooosh... well the first problem with this code is the Do / Loop - it opens but never ends?

each do / loop should have a method to exit

do until / loop
do / loop until

Although you do have an Exit Do in there, having run the code the two conditions never = 1 and it cycles indefinately..

randomNumber = Round(Rnd * 4 + 1) ' generates a random number between 1 and 4

no it doesn't, when you generate a random number like this the possible range will be 1 to 5, a better, but still not ideal method would be

(rnd() * 4)+1