A AppLex New Member Licensed User Aug 1, 2017 #1 There seems to be a problem when using If … Then Wait For on one line: B4X: Private x As Int = 4 If x < 5 Then Wait For SecondSub_Complete This code results in the following error: "Undeclared variable 'wait' is used before it was assigned any value." The following version works fine: B4X: Private x As Int = 4 If x < 5 Then Wait For SecondSub_Complete End If Last edited: Aug 1, 2017
There seems to be a problem when using If … Then Wait For on one line: B4X: Private x As Int = 4 If x < 5 Then Wait For SecondSub_Complete This code results in the following error: "Undeclared variable 'wait' is used before it was assigned any value." The following version works fine: B4X: Private x As Int = 4 If x < 5 Then Wait For SecondSub_Complete End If
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2017 #2 This is a limitation of Wait For. It must start on its own line.