D dais Member Licensed User Longtime User Mar 28, 2015 #1 There is a code: B4X: Sub p_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float) r=Ceil(Roll) If r>0 Then crossx=crossx+5 Else crossx=crossx-5 End If If crossx>740 Then crossx=740 End If crossx=crossx+1 If crossx<40 Then crossx=40 End If End Sub So, it shows me error with Error description: Missing Keyword: end sub How could it be end sub needed here? Am I missing something? I saw similar post here https://www.b4x.com/android/forum/t...issing-keyword-end-sub-while-not-needed.9849/ , but I can not understand what is wrong with code?
There is a code: B4X: Sub p_OrientationChanged (Azimuth As Float, Pitch As Float, Roll As Float) r=Ceil(Roll) If r>0 Then crossx=crossx+5 Else crossx=crossx-5 End If If crossx>740 Then crossx=740 End If crossx=crossx+1 If crossx<40 Then crossx=40 End If End Sub So, it shows me error with Error description: Missing Keyword: end sub How could it be end sub needed here? Am I missing something? I saw similar post here https://www.b4x.com/android/forum/t...issing-keyword-end-sub-while-not-needed.9849/ , but I can not understand what is wrong with code?
RandomCoder Well-Known Member Licensed User Longtime User Mar 28, 2015 #2 It should be "Else If" not just "Else". Upvote 0
D dais Member Licensed User Longtime User Mar 28, 2015 #3 Thank you. My bad for Else If, but now it shows the same error for End If after If crossx>740Then crossx=740, what's wrong with it? Upvote 0
Thank you. My bad for Else If, but now it shows the same error for End If after If crossx>740Then crossx=740, what's wrong with it?
klaus Expert Licensed User Longtime User Mar 28, 2015 #4 This is wrong: If crossx > 740 Then crossx = 740 End If It should be: If crossx > 740 Then crossx = 740 without the End If or If crossx > 740 Then crossx = 740 End If Upvote 0
This is wrong: If crossx > 740 Then crossx = 740 End If It should be: If crossx > 740 Then crossx = 740 without the End If or If crossx > 740 Then crossx = 740 End If