Missing Keyword: end sub

dunski

Member
Licensed User
Longtime User
Hi Can anyone help please.
I just can't see why I am getting this error. I have included the code for the sub below.

Compiling code. Error
Error parsing program.
Error description: Missing Keyword: end sub
Occurred on line: 221
End If

B4X:
Sub bEnter_Click

   myNumber =txtNum.Text 
   If transactFlag= False Then
      If myNumber.Length <> 10 Then 
         Msgbox("Incorrect number of characters, please enter  your number again","Loyalty Program")
         Exit Sub
      Else
         lblDisplay.Text="Enter transaction amount and click enter"
         lblDisplay.TextColor=Colors.Red
         transactFlag=True
         txtNum.Text=""
         txtNum.INPUT_TYPE_DECIMAL_NUMBERS
         txtNum.Color=Colors.LightGray
      End If ' this is line 221
   Else
      transaction(myNumber)
   End If
txtNum.Text = ""

End Sub
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
Baffling missing End Sub error

i'm now getting this message on the las line shown below:
Sub pnlMap_Touch (Action As Int, X As Float, Y As Float)
If MapCalibrating = False Then
Return
End If
If CurrentCalibrationPoint <> 1 AND
CurrentCalibrationPoint <> 2 Then
Return
End If

PS the following have their 'Dims' in Process_Globals:
Dim MapCalibrating As Boolean : MapCalibrating = False
Dim CurrentCalibrationPoint As Int : CurrentCalibrationPoint = 0

pnlMap is a Panel drawn in Designer with its 'Dim pnlMap as Panel' defined in Globals
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
Thank you

This
B4X:
If CurrentCalibrationPoint <> 1 AND
     CurrentCalibrationPoint <> 2 Then
     Return
End If
should be
B4X:
If CurrentCalibrationPoint <> 1 AND CurrentCalibrationPoint <> 2 Then
    Return
End If
Best regards.

Thanks for that. Habits die hard: I'm used to Gambas where no continuation character is need.
 
Upvote 0
Top