I have a scoreboard function that I'm working on and there will need to be a lot of indepth (for me) code to weed out impossible/invalid scores
Here is the code as it stands without any of my failed attempts at error checking.
Private Sub scoreInput_Click()
Dim score As Integer
Dim scored As Integer
Dim thrown As Integer
thrown = dartsThrown.Caption
score = Label1.Caption
scored = TextBox1
Select Case scored
Case 60 To 99
sixtyplus.Caption = sixtyplus + 1
Case 100 To 139
tonplus.Caption = tonplus + 1
Case 140 To 179
t40.Caption = t40 + 1
Case 180
t80.Caption = t80 + 1
End Select
dartsThrown.Caption = thrown + 3
Label1.Caption = (score - scored)
TextBox1.Text = ""
TextBox1.Activate
If Label1.Caption = 0 Then
Call submitLeg_Click
End If
End Sub
Impossible scores: Less than 0, 163, 166, 169, 172, 173, 175, 177, 178, 179, 181 and above.
Impossible scores to end a game with (that results in 'score' going to zero): 159, 162, 163, 165, 166, 168, 169, 171 and above.
Score remaining: Any 'scored' value that results in 'score' being less than zero has to stop everything. I've made several attempts at this that are logical to me but still seem to subtract the score anyway.
Bookmarks