I came across a bug in some VB6 code this morning which wasn’t evaluating correctly. The code is in the following format:
<Boolean Value 1> Or <Boolean Value 2> And <Boolean Value 3>
The fix (in this case) was to put parentheses in as follows:
(<Boolean Value 1> Or <Boolean Value 2>) And <Boolean Value 3>
Because the And was being incorrectly evaluated first so my question is – Is this always the case?
I assume that things like + – * are evaluated using the BIDMAS rule but what about these operators And Or Not XOr Is <> etc
Operator Precedence in Visual Basic
Precedence in order of appearance: