Modifying the Sequence That Siebel eScript Uses to Evaluate an Expression
Siebel eScript evaluates the operators in an expression in the following order:
Arithmetic operators
Comparison operators
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.
The following table includes an example of how Siebel eScript calculates 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. |