I'm making a trivia program in visual basic 6. Each question is on a frame, like a card. The cards come up randomly and I'd like to make it so that the same question will not come up twice. I've tried to use tags (fraQuestion.tag) and set the value = 0 at the beginning of the program and then to 1 once the frame is displayed. This seems like it should work, but it doesn't. It just freezes my program.
2006-12-22
01:39:53
·
6 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
When I started the program, I did it without the tags and it worked wonderfully. I then added the lines for the tags and it stopped working.
Private Sub lblHistory_Click()
Dim PickRand As Single
Pick: PickRand = Int((Rnd * 3) + 1)
If PickRand = 1 And fraHistory1.Tag = 0 Then
fraHistory1.Visible = True
Else: GoTo Pick
End If
If PickRand = 2 And fraHistory2.Tag = 0 Then
fraHistory2.Visible = True
Else: GoTo Pick
End If
If PickRand = 3 And fraHistory3.Tag = 0 Then
fraHistory3.Visible = True
Else: GoTo Pick
End If
End Sub
2006-12-22
01:55:11 ·
update #1