In the video you say you set the max to 100. Here is how you can do that programmatically.
Create a new form-level variable like
Then when you read a question file do this.Code:Private mlngMaxAnswer As Long
And finallyCode:Dim lngMax As Long Open (App.Path & "\text\audiencepollquestions2.txt") For Input As 1 For i = 1 To 35 Line Input #1, tmpstr tmp = Split(tmpstr, "|") Question(i) = tmp(0): ans(i) = tmp(1) If ans(i) > lngMax Then lngMax = ans(i) End If Next i Select Case lngMax Case 0 To 10 mlngMaxAnswer = 10 Case 11 To 100 mlngMaxAnswer = 100 Case Else mlngMaxAnswer = 99999 '? End Select
Code:Private Sub Command2_Click() If Val(Text1.Text) < 0 Or Val(Text1.Text) > mlngMaxAnswer Then MsgBox "Answer must be between 0 and " & mlngMaxAnswer & "." Text1.Enabled = True Else RDNumber.Visible = True RDNumber.Caption = Val(Text1.Text) Text1.Enabled = False WhosTurn = BluePlayer token = AskHigherLower End If End Sub




Reply With Quote