Android Question single line multi commands

sorex

Expert
Licensed User
Longtime User
Hello,

In several languages I can do this:

B4X:
If myvar="" Then showalert:Exit

the B4A precompile pass doesn't give an error on this
but during the java compile it gives this error

B4X:
src\b4a\example\main.java:323: error: break outside switch or loop
if (true) break;
          ^
1 error

using exit sub also fails.

ain't there a way to get this working without all the extra linefeeds and end if's ?
 

sorex

Expert
Licensed User
Longtime User
ok, it seems that I had to use return instead of the exit method like in VB and others.
 
Upvote 0
Top