As Erel suggested, I'm posting the code I typed in for the new tutorial as I get an error message regarding:
This refers to this section of code near the end:
Maybe I just need to get new eyeglasses, but I don't see what's wrong?
Thanks,
Mark
Missing Keyword: End Sub
Occurred on line: 33
End If
This refers to this section of code near the end:
B4X:
Else
AppClose
End If
End If
Maybe I just need to get new eyeglasses, but I don't see what's wrong?
Thanks,
Mark
B4X:
Sub Globals
'Declare the global variables here.
Dim Number
End Sub
Sub App_Start
Form1.Show
Number = Rnd(1,100)'Randomly chooses a number
End Sub
Sub btnGuess1_Click
If Not (IsNumber(txtNumber1.Text))Then 'User didn't enter valid number
'Same as If Not (IsNumber(txtNumber1.Text)= False Then
Msgbox ("Please enter a valid number")
Return
End If
If txtNumber1.Text > number Then 'Check the user guess
Msgbox ("My number is smaller")
Else If txtNumber1.Text < number Then
Msgbox ("My number is larger")
Else 'The user has found the right number
Msgbox ("Congrats, you've found the right number!"& crlf & "Do you want to play a new game?", "", cMsgbox YesNo) = cYes Then
number = Rnd (1,100)
Else
AppClose
End If
End If
txtNumber1.focus 'Returns focus to textbox & selects text
txtNumber1.SelectionStart = 0
txtNumber1.SelectionLength = StrLength (txtNumber1.Text)
End Sub