Visual Basic in 12 Easy Lessons velxa.htm

Previous Page TOC Next Page



Appendix A


Operator Precedence


There are three sets of operators, arithmetic, comparison, and logical operators. This appendix's three tables describe each operator set's order of precedence.

Table A.1. The arithmetic operator precedence.

Level Operator
1 Exponentiation (^)
2 Negation (-)
3 Multiplication and division (*, /)
4 Integer division (\)
5 Modulo division (Mod)
6 Addition and subtraction (+, -)
7 String concatenation (&)

Table A.2. The comparison precedence.

Level Operator
1 Equality (=)
2 Inequality (<>)
3 Less than (<)
4 Greater than (>)
5 Less than or equal to (<=)
6 Greater than or equal to (>=)
7 Like

Table A.3. The logical operator precedence.

Level Operator
1 Not
2 And
3 Or
4 Xor
5 Eqv
6 Imp
7 Is

Previous Page Page Top TOC Next Page