Closed Nju79 closed 1 year ago
Maybe AND binds higher than NOT, in which case your results were OK. Did try grouping with parenthesis?
Why there should be a priority binding there if both examples above come to the same result?
Just saying. I couldn't find a something in the language specs about the binding strengths.
But if =
binds higher than AND
, and AND
binds higher than NOT
, then both of your outcomes are correct, because:
a = 9 AND b = 6
and a = 9 AND b = 5
is false, negating it makes it true, hence "Yep" is printed.
But this is just assumption. I don't know what binds higher.
Thank you for your explanation. I've cross-tested this and it seems like AND
has a higher binding than NOT
. Parenthesis like
(NOT a = 9)
seems to be working.
Following Code writes every time "Yep" in the console:
a.b = 10
b.b = 5
If NOT a = 9 AND b = 6 Then Print "Yep"
END
If I change the code to
a.b = 10
b.b = 5
If NOT a = 9 AND b = 5 Then Print "Yep"
END
the same behaviour occurs. In my opinion the
and b = x
is completly ignoring by the compiler, isn't it?