Expressions

An expression is any statement that has a value. The simplest form of expression is a literal, however expressions can be as complex as any legal combination of operators, conditions, functions, and values you can imagine.

Expression components

Literal values

A literal value is a value written exactly as it is meant to be interpreted, such as the character literal 'my value'. For information about literals, see Data types.

Operators

Operators are symbols that tell the script interpreter to perform arithmetic, string, comparison, or logical evaluation of the specified values:

Operator type in order of precedence Operators in order of precedence Examples
Parenthesis
  • () specifies precedence
  • () function operator
(5 + 3) * 2
Unary
  • NOT logical
  • - negation
v_truth = NOT (3 < 2)
Arithmetic
  • ^ exponentiation
  • * multiplies, / divides
  • + adds, - subtracts

Note

Multiplicative operators have equal precedence with each other and evaluate from left to right.

Additive operators have equal precedence with each other and evaluate from left to right.

1 + 5 - 3 * 2
String + concatenates "This is" + " my script"
Comparative
  • < less than
  • > greater than
  • = equality
  • >= greater than or equal to
  • <= less than or equal to
  • <> not equal

Note

Comparative operators have equal precedence with each other and evaluate from left to right.

IF amount <> 100
Binary logical
  • AND or &
  • OR or |
IF amount > 5 AND amount < 10

Functions

Expressions are evaluated using the values returned by functions. Functions execute with the highest precedence of any expression component. For more information about functions, see Functions.

Example expressions

Evaluates to 6

(2 + (3 - 2)) * 2

Evaluates to true

((2 + (3 - 2)) * 2) > ROOT(9,0)

Evaluates to 'ACLScript tutorial'

'AC' + 'LScri' + 'pt ' + 'tutorial'