Bookshelf Home | Contents | Index | PDF

### Changing the Sequence in Which Siebel eScript Evaluates an Expression

Siebel eScript evaluates the operators in an expression in the following order:

1. Arithmetic operators
2. Comparison operators
3. Logical operators

You can write code that changes this order.

To change the sequence in which Siebel eScript evaluates an expression

• Use parentheses to group operations.

Siebel eScript performs operations in parentheses before it performs operations that occur outside of parentheses. It performs multiplication operations and division operations in an expression before it performs addition operations and subtraction operations. To change this sequence, you can use parentheses.

Table 12 includes an example of how Siebel eScript calculates a grouped expression.

Table 12. Example of Calculating a Grouped Expression
No Grouping
Equivalent
Not Equivalent

4 * 7 - 5 * 3 = 13

Siebel eScript calculates this expression as 28 - 15 = 13.

(4 * 7) - (5 * 3) = 13

Siebel eScript calculates this expression as 28 - 15 = 13.

4 * (7 - 5) * 3 = 24

Siebel eScript calculates this expression as 4 * 2 * 3 = 24.