Prev | Current Page 138 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

The value was then
printed to screen a third time while decrementing the value. However, as the decrement value was
appended after the variable, its value was not calculated until after it was printed, so 1 was displayed a
second time. Finally, the current value was printed to screen, which should then be 0.
Logical Comparison Operators
Logical comparison operators are used to discern the differences or equality of values and expressions.
Like binary operators, the logical comparison operators work with two values or expressions; one to
either side of the operator. All logical comparison operators return a boolean value. true is returned if
the comparison expression is true and false if the expression is false.
The most common form of logical comparison is to test whether two expressions are equal ( == ) or not
equal ( != ):
var myBoolA : Bool = (1 != 2);
var myBoolB : Bool = (1 == 2);
Here, myBoolA will be true , as 1 is not equal to 2, which will mean the expression for myBoolB (1 is
equal to 2) will be false .


Pages:
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150