Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quiz Problem

Status
Not open for further replies.

skippypaul

Programmer
Nov 20, 2002
3
0
0
US
I am writing a quiz programme and have set up an "if..then..else" routine to check that the question has not been previously asked. The routine works fine until it finds a question that has been asked. I'm not sure what to put in the "..else" part (to replace the ?????) to return the programme to pick the next random number (question).

The coding I've used is as follows:

Dim I As Integer
I = (Int(Rnd * 42) + 1)
If QuestionAsked(I) = "No" Then
QuestionAsked(I) = "Yes"
Else: ???????
End If
 

First of all I believe I would change the structure to a loop such as

Dim I As Integer

Do
I = (Int(Rnd * 42) + 1)
loop until questionAsked(i) = false

askQuestion(i)

hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top