G Genricke Member Apr 8, 2021 #1 Hi ! Simple example: compiles and runs - no problem ! B4X: Sub EasyTest If 2 = 2 Then Log(1) If 3 = 5 Then Log("One") else If 4 = 4 Then Log("Two") Log(3) End If End Sub Waiting: 1 -> Two -> 3 Reality: 1 Why ?! Thanks ! Last edited: Apr 8, 2021
Hi ! Simple example: compiles and runs - no problem ! B4X: Sub EasyTest If 2 = 2 Then Log(1) If 3 = 5 Then Log("One") else If 4 = 4 Then Log("Two") Log(3) End If End Sub Waiting: 1 -> Two -> 3 Reality: 1 Why ?! Thanks !
Erel B4X founder Staff member Licensed User Longtime User Apr 9, 2021 #2 The IDE marks the condition block: I think that it explains the flow. Correct code to get the result you expect: B4X: Sub EasyTest If 2 = 2 Then Log(1) If 3 = 5 Then Log("One") Else If 4 = 4 Then Log("Two") End If Log(3) End If End Sub Upvote 0
The IDE marks the condition block: I think that it explains the flow. Correct code to get the result you expect: B4X: Sub EasyTest If 2 = 2 Then Log(1) If 3 = 5 Then Log("One") Else If 4 = 4 Then Log("Two") End If Log(3) End If End Sub