Android Question WHY conditions of If MUST be ONE line ?

qkb 75

Member
If-Then-Else

I want to write in below style , BUT B4A say , it's wrong!!
If (cur_test == 0) AND
(rdSelectA.Checked == False ) AND
(rdSelectB.Checked == False ) AND
(rdSelectC.Checked == False ) AND
(rdSelectD.Checked == False ) AND
(rdSelectE.Checked == False ) AND
(rdSelectF.Checked == False )
Then
.....

I HAVETO write in such style (made a very long ONE line),and make B4A satisfaction:
If cur_test == 0 AND rdSelectA.Checked == False AND rdSelectB.Checked == False AND rdSelectC.Checked == False AND rdSelectD.Checked == False AND rdSelectE.Checked == False AND rdSelectF.Checked == False Then
......
 

stevel05

Expert
Licensed User
Longtime User
You need to use the line break character try:

B4X:
If (cur_test == 0) _
AND (rdSelectA.Checked == False ) _
AND (rdSelectB.Checked == False ) _
AND (rdSelectC.Checked == False ) _
AND (rdSelectD.Checked == False ) _
AND (rdSelectE.Checked == False ) _
AND (rdSelectF.Checked == False ) _
Then
 
Upvote 0

qkb 75

Member
Thank you!

There are a balance in YACC of B4A :
1) C_STYLE : CFLR are omitted . BUT must have set sentence_end_flag ,which like ' ;' or '.' , this flag will make your code a mess .
2) SCRIPT_STYLE : Use CFLR_flag as sentence_end_flag , will make code clean . BUT must have set line_continue_flag ,which like '-' or '_' .
 
Upvote 0
Top