H Himred Member Licensed User Longtime User Sep 7, 2014 #1 Hi ! Would you consider allowing in addition of the current ones the 2 following syntaxes: Syntax 1: Why a then should be on the same line finally ? As président of the freedom for then foundation i would love that b4a give more freedom for them/n and allow Code: If a=3 Then x=2 y=3 Else X=0 End if Ultimatly you even could make that then optional, so they can get some rest and allow: Code: If a=3 x=2 y=3 Else X=0 End if Allowing additional syntaxes for a much used statement like then will allow more users coming from other languages to love b4a without annoying the basic pros. Thanks for reading. Himred président of the FFTF. Regards.
Hi ! Would you consider allowing in addition of the current ones the 2 following syntaxes: Syntax 1: Why a then should be on the same line finally ? As président of the freedom for then foundation i would love that b4a give more freedom for them/n and allow Code: If a=3 Then x=2 y=3 Else X=0 End if Ultimatly you even could make that then optional, so they can get some rest and allow: Code: If a=3 x=2 y=3 Else X=0 End if Allowing additional syntaxes for a much used statement like then will allow more users coming from other languages to love b4a without annoying the basic pros. Thanks for reading. Himred président of the FFTF. Regards.
thedesolatesoul Expert Licensed User Longtime User Sep 8, 2014 #2 You need a delimiter after the condition exprrssion.
J James Chamblin Active Member Licensed User Longtime User Sep 8, 2014 #3 thedesolatesoul said: You need a delimiter after the condition exprrssion. Click to expand... I have used BASIC variants in which a new line acts as an implied then. So Code: If a = 3 Then x = 7 If a = 3 Then x = 7 End If If a=3 Then x = 7 End If If a=3 x = 7 End If Would all be equivalent. However Code: If a = 3 x = 7 would throw an error as neither then nor a new line separates the condition to the rest of the code. I have never seen Then on its own line before though, maybe a VB thing? My post here isn't to imply a +1. The then requirement doesn't bother me that much. Just wanted to note that it is not an unusual thing.
thedesolatesoul said: You need a delimiter after the condition exprrssion. Click to expand... I have used BASIC variants in which a new line acts as an implied then. So Code: If a = 3 Then x = 7 If a = 3 Then x = 7 End If If a=3 Then x = 7 End If If a=3 x = 7 End If Would all be equivalent. However Code: If a = 3 x = 7 would throw an error as neither then nor a new line separates the condition to the rest of the code. I have never seen Then on its own line before though, maybe a VB thing? My post here isn't to imply a +1. The then requirement doesn't bother me that much. Just wanted to note that it is not an unusual thing.
Beja Expert Licensed User Longtime User Jan 16, 2015 #5 AND, OR, XOR.... etc will complain from discrimination . If a=3 b=2 (implied AND between them)
T Troberg Well-Known Member Licensed User Longtime User Jan 23, 2015 #8 thedesolatesoul said: You need a delimiter after the condition exprrssion. Click to expand... Not really. Newline works as a delimiter, and if you want it on the same line, colon. If x=0 DoStuff End If One line version: If X=0 : Dostuff "Then" is just a useless atavism, like the appendix or the tail bone. I say we put it on a big bonfire and dance happily naked around it, chanting happy songs. Oh, while we are at it, it would be nice if the editor autocorrected "endif" to "End If". I've noticed that old habits die hard. Very hard.
thedesolatesoul said: You need a delimiter after the condition exprrssion. Click to expand... Not really. Newline works as a delimiter, and if you want it on the same line, colon. If x=0 DoStuff End If One line version: If X=0 : Dostuff "Then" is just a useless atavism, like the appendix or the tail bone. I say we put it on a big bonfire and dance happily naked around it, chanting happy songs. Oh, while we are at it, it would be nice if the editor autocorrected "endif" to "End If". I've noticed that old habits die hard. Very hard.