Siebel eScript Language Reference > Using Siebel eScript > Using Operators in Siebel eScript >

Modifying the Sequence That Siebel eScript Uses to Evaluate 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 modifies this order.

To modify the sequence that Siebel eScript uses to evaluate 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. You can use parentheses to modify this sequence.

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

Table 11. 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.

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.