Android Question Are the logical operators short-circuit?

Joacim

Member
Licensed User
Longtime User
Hi, I'm new to Basic4Android and was just wondering if the logical operators (AND & OR) are short-circuit or not?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes. They are converted to && and || in Java.
This is true. In release mode the operators are converted to && or ||. In debug mode they are converted to something different (which behaves the same but runs in the rapid engine).

The operators behavior are based on B4A language design not on the Java operators. The compiler could have easily generate different code if the language design was different.
 
Upvote 0

Joacim

Member
Licensed User
Longtime User
Thanks Erel. To be honest: I don't really care what they are converted to since I'm really just interested in their behavior. :)
 
Upvote 0

Joacim

Member
Licensed User
Longtime User
I must say that I'm really impressed by this tool. I bought a license after just watching some presentations on YouTube, I didn't even bother to download the trial first.
 
Upvote 0
Top