Boolean Double Comparison

From The Oxygene Language Wiki

Jump to:navigation, search

This is a Language topic
Feel free to add your notes to this topic below.



A minor but a very handy feature, comparison operators now can be used for expressions such as:

if 5 < y < 10 then ...

to test if y is between 5 and 10. This is more than just syntactic sugar as Boolean short-circuits apply and there is only a single variable to evaluate. Compare this with

if (5 < y) and (y < 10) then ...

where y would be evaluated twice if it is not less than 5 (imagine y being a property or a complex method).


See Also


Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox