This section provides lists of mathematical, logical and conditional expressions.

## Precedence of operations

Generally, operations are performed with the same order of precedence as in basic math. For example, the exponent operation is performed before the multiply and divide operations, and the multiply and divide operations are performed before the plus and minus operations. The

*XFDL Specification* contains a complete list of the operations available and their order of precedence.

## Functions

Actions give you access to standard functions that are part of XFDL, functions that are built intoViewer, and custom functions that you either write yourself or import from other sources. For more information on functions, see

Functions.

## Complex actions

You can concatenate two or more expressions in the Custom Action Editor with the

`+` operator to create a calculation that performs multiple actions. The code fragment below demonstrates the technique. It sets the background color of both FIELD1 and FIELD2 to green in the same action.

set('FIELD1.bgcolor', 'green') + set('FIELD2.bgcolor', 'green')

You can concatenate as many expressions as you want. The only limit is your imagination and the available computing resources. However, when your actions become long and complex, you might want to spread them over several lines.

## Multi-line actions

You can make complex actions easier to read and maintain by breaking them into several lines. You do not need to take any special measures when you are working in the Custom Action Editor, other than to make sure that you do not break the lines in the middle of strings.

Conditional expressions (if/then/else)
A conditional expression compares two values and returns true if the condition is met, and false if the condition is not met. The values are compared using one of the comparison operators from the table below.

Logical operators
Boolean logical operators for AND, OR, and NOT. If you choose to use the alphabetic form of the logical operators AND, OR, and NOT, you must spell them with all lower case letters.

Mathematical expressions
The table below contains a list of mathematical expressions and the arithmetic operations they represent.

**Parent topic: **Adding interactive features