Using Logical Operators and Conditional Expressions
Note the following:
A logical operator is a type of operator that compares two values, and then determines if the result is true or false. A variable or any other expression can include true or false.
A conditional expression is an expression that does a comparison.
You can use a logical operator to make a decision about the statements that reside in a script to run according to how Siebel eScript evaluates a conditional expression.
The following table describes the logical operators that you can use in Siebel eScript.
Logical Operator | Description |
---|---|
! |
Not. Reverse of an expression. If (a+b) is true, then !(a+b) is false. |
&& |
And. If the value of every expression in the statement is true, then the entire statement is true. For example, if the first expression is false, then Siebel eScript does not evaluate the second expression because the entire expression is false. |
|| |
Or. If the value of one expression in the statement is true, then the entire statement is true. For example, if the first expression is true, then Siebel eScript does not evaluate the second expression because the entire expression is true. |
== |
Equality. If the values of all expressions in the statement are equal to each other, then the entire statement is true. If the value of one expression is not equal to the value of any other expression, then the entire statement is false. Caution: The equality operator (==) is different from the
assignment operator (=). If you use the assignment operator to test
for equality, then your script fails because Siebel eScript assigns
after the expression to a variable that precedes this expression. For more information, see Using the Equality Operator with a Strongly Typed Variable. |
!= |
Inequality. If the value of one expression is different from the value of any other expression, then the entire statement is true. If the value of all expressions in the statement are equal, then the entire statement is false. |
< |
Less than. If the expression is a < b, and if a is less than b, then the statement is true. |
> |
Greater than. If the expression is a > b, and if a is greater than b, then the statement is true. |
<= |
Less than or equal to. If the expression is a <= b, and if a is less than or equal to b, then the statement is true. |
>= |
Greater than or equal to. If the expression is a >= b, and if a is greater than or equal to b, then the statement is true. |