I Karma I
02-09-2008, 05:06 PM
I am just messing around with textboxes and whatnot, here is my code:
Dim total As Integer
Private Sub clear_Click()
Cls
End Sub
Private Sub Cmd_add_Click()
If textbox.Text = 5 Then
Cls
Print "You got it!"
Print "Type in 15 for your next test!"
Else
Print "Guess again! +1 to total"
total = total + 1
End If
If total >= 5 Then
Print "You failed!"
End If
If textbox.Text = 15 Then
total = 0
Cls
Print "1234568 - whats missing?"
End If
If textbox.Text = 7 Then
Cls
Print "you finished!"
Else
Print "Guess again!"
total = total + 1
End If
End Sub
Now when I type 5, it says I got it correct, but it ALSO says guess again down the bottom..
I then type 15, and it says the whats missing part AND guess again..
I then type 7 and it says You finished.
Whats wrong with the code?
Dim total As Integer
Private Sub clear_Click()
Cls
End Sub
Private Sub Cmd_add_Click()
If textbox.Text = 5 Then
Cls
Print "You got it!"
Print "Type in 15 for your next test!"
Else
Print "Guess again! +1 to total"
total = total + 1
End If
If total >= 5 Then
Print "You failed!"
End If
If textbox.Text = 15 Then
total = 0
Cls
Print "1234568 - whats missing?"
End If
If textbox.Text = 7 Then
Cls
Print "you finished!"
Else
Print "Guess again!"
total = total + 1
End If
End Sub
Now when I type 5, it says I got it correct, but it ALSO says guess again down the bottom..
I then type 15, and it says the whats missing part AND guess again..
I then type 7 and it says You finished.
Whats wrong with the code?