• Login

DataSoft Corporation

Operator Precedence

When an expression contains multiple operators, their precedence controls the order in which expression elements are evaluated.

  • Literal values
  • Parameters
  • Identifiers
  • OR (left-associative)
  • AND (left-associative)
  • '.' relationship qualifier (left-associative)
  • ==, !=
  • <, >, <=, >=
  • -, + (left-associative)
  • *, /, % (left-associative)
  • NOT
  • unary -
  • In
  • Iif
  • Trim(), Len(), Substring(), IsNull()
  • '[]' (for set-restriction)
  • '()'

The default precedence can be changed by grouping elements with parentheses. For instance, the operators are performed in a default order in the first of the following two code samples. In the second code sample, the addition operation is performed first, because its associated elements are grouped with parentheses, and the multiplication operation is performed last.

Accounts[Amount == 2 + 48 * 2]

Accounts[Amount == (2 + 48) * 2]

Thursday, 27 December 2018 Posted in Expressions Constants, Operators, and Functions