Operator Precedence (topic)

The following table shows the precedence of the operators supported by the Basic Control Engine. Operations involving operators of higher precedence occur before operations involving operators of lower precedence. When operators of equal precedence occur together, they are evaluated from left to right.

Operator Description Precedence Order
() Parentheses Highest
^ Exponentiation
- Unary minus
/, * Division and multiplication
\ Integer division
Mod Modulo
+, - Addition and subtraction
& String concatenation
=, <>, >, <, <=, >= Relational
Like, Is String and object comparison
Not Logical negation
And Logical or binary conjunction
Or Logical or binary disjunction
Xor, Eqv, Imp Logical or binary operators Lowest
The precedence order can be controlled using parentheses, as shown below:
  a = 4 + 3 * 2      'a becomes 10.
  a = (4 + 3) * 2    'a becomes 14.