Why #if C, JAVA, etc. ?

KMatle

Expert
Licensed User
Longtime User
Maybe stupid but... If we use inline C, JAVA, etc. in our B4x code why does it start with an #if? An IF usually checks if a condition is true. So when you add f.e. some Java code there is no doubt about it. Wouldn't it be better to use something like #InlineJava or #InlineC? The online thing I can imagine that this is coming from to check if it's B4A, B4J, etc.

PS: B4x is soooo stable that I have to post stupid side questions ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It was simple to extend the conditional compilation feature like this, when support for inline code was added.
The parser (and there are actually several parsers running) treats it like all other excluded code and skips it.

It could have been named differently, of course, however I tend to avoid adding more attributes and keywords.
 
Top