Wish Preprocessor defines in B4X

wonder

Expert
Licensed User
Longtime User
If possible, I think it would be useful having the #define keyword added to the B4X preprocessor.
 

wonder

Expert
Licensed User
Longtime User
- No memory consumption (indeed an INT is only 4 bytes, but still "a penny saved is a penny earned"...)
- For constants, it's faster to write #define EULER 0.5772156649... than Dim EULER as Double = 0.5772156649...
- For macros, it's faster to write #define OFFSCREEN (x < 0 OR y < 0 OR x > 100%x OR y > 100%y) than creating a method
B4X:
Sub OffScreen(x as double, y as double) As Boolean
    Return (x < 0 OR y < 0 OR x > 100%x OR y > 100%y)
End Sub

It's just a suggestion and only if it doesn't take a lot of effort to implement. :)
 
Top