Sub Globals
'Declare the global variables here.
score = 0
count = 1
currentNumber = 0
Dim numbers(100)
End Sub
Sub App_Start
Form1.Show
For i = 0 To 99
numbers(i) = Rnd(1,101)
Next
Shownumbers
End Sub
Sub Shownumbers
For i = 0 To count - 1
s = s &" " & numbers(i)
Next
Msgbox(s, "Your score is " & score)
End Sub
Sub textbox1_KeyPress(key)
If Asc(key) = 13 Then
If textbox1.text = numbers(currentNumber) Then
Msgbox("Correct!")
currentNumber = currentNumber + 1
score = score + 1
Else
'wrong answer
End If
textbox1.Text = ""
If currentNumber = count Then
count = count + 1
currentNumber = 0
Shownumbers
End If
End If
End Sub