nikolaus Member Licensed User Longtime User Jun 14, 2014 #1 Following wrong code: If a = b log (a)End If underlines End If in red and generates the error message: Missing Keyword: end sub (B4A 3.80)
Following wrong code: If a = b log (a)End If underlines End If in red and generates the error message: Missing Keyword: end sub (B4A 3.80)
Y yazak Member Licensed User Longtime User Jul 15, 2014 #2 You didn't put in the "Then" If a=b Then Log(a) End if
nikolaus Member Licensed User Longtime User Jul 15, 2014 #3 Yes you are right as I wrote before. The error message is wrong, it states 'Missing Keyword: End Sub'. It should be something like 'Missing Keyword: Then'
Yes you are right as I wrote before. The error message is wrong, it states 'Missing Keyword: End Sub'. It should be something like 'Missing Keyword: Then'
Y yazak Member Licensed User Longtime User Jul 15, 2014 #4 A error I have noticed is this If a=b Then a=1 : b=2 Then above would work like this If a=b Then a=1 b=2 And not like you would expect If a=b Then a=1 b=2 End if
A error I have noticed is this If a=b Then a=1 : b=2 Then above would work like this If a=b Then a=1 b=2 And not like you would expect If a=b Then a=1 b=2 End if
Erel B4X founder Staff member Licensed User Longtime User Jul 16, 2014 #5 This is by design. A colon is identical to a new line.
Y yazak Member Licensed User Longtime User Jul 16, 2014 #6 I am use to using VB6 and Pure Basic In VB6 anything on same line after Then including colon is part of the Then In Pure Basic there is know Then in If 's and you have to end If 's with EndIf Pure Basic example: If a=b : a=1 : b=2 : EndIf Last edited: Jul 16, 2014
I am use to using VB6 and Pure Basic In VB6 anything on same line after Then including colon is part of the Then In Pure Basic there is know Then in If 's and you have to end If 's with EndIf Pure Basic example: If a=b : a=1 : b=2 : EndIf
nikolaus Member Licensed User Longtime User Jul 16, 2014 #7 Well, this is B4A. Please checkout the documentation. Anything that works as described is a feature. Only if it behaves different from how it should, it is a bug. If you think a feature needs improvement then post a whish.
Well, this is B4A. Please checkout the documentation. Anything that works as described is a feature. Only if it behaves different from how it should, it is a bug. If you think a feature needs improvement then post a whish.
Del Member Licensed User Longtime User Jul 20, 2014 #8 "In VB6 anything on same line after Then including colon is part of the Then" This is incorrect for VB versions. If a=b then a=1 : b=2 : End If does not even compile.
"In VB6 anything on same line after Then including colon is part of the Then" This is incorrect for VB versions. If a=b then a=1 : b=2 : End If does not even compile.
Y yazak Member Licensed User Longtime User Jul 21, 2014 #9 Of course not you have put a End if on single line If Then Should be for VB6 If a=b then a=1 : b=2 Or multi line like this If a=b Then a=1 b=2 End if By the way I am not concerned about the difference in B4A I was just pointing it out so users of VB6 are aware of the differences, as I could not at first work out why some of my code was not working as expected.
Of course not you have put a End if on single line If Then Should be for VB6 If a=b then a=1 : b=2 Or multi line like this If a=b Then a=1 b=2 End if By the way I am not concerned about the difference in B4A I was just pointing it out so users of VB6 are aware of the differences, as I could not at first work out why some of my code was not working as expected.