Idoc Script supports several operators. This section describes the following:
Use the following comparison operators compare the value of two operands and return a true or false value based on the result of the comparison. These operators can be used to compare integers and Boolean values in Idoc Script.
If you are using Idoc Script in an HCSP or HCSF page, you must use special comparison operators. For more information, see the Oracle Fusion Middleware Developer's Guide for Content Server.
Operator | Description | Example |
---|---|---|
== | equality | <$if 2 == 3$> evaluates to false |
!= | inequality | <$if 2 != 3$> evaluates to true |
< | less than | <$if 2 < 2$> evaluates to false |
<= | less than or equal | <$if 2 <= 2$> evaluates to true |
> | greater than | <$if 3 > 2$> evaluates to true |
>= | greater than or equal | <$if 3 >= 2$> evaluates to true |
These are numeric operators that are useful with strings only in special cases where the string data has some valid numeric meaning, such as dates (which convert to milliseconds when used with the standard comparison operators).
For string concatenation, string inclusion, and simple string comparison, use the Special String Operators.
To perform advanced string operations, use strEquals, strReplace, or other string-related global functions.
Use the following special string operators to concatenate and compare strings:
Operator | Description | Example |
---|---|---|
& | The string join operator performs string concatenation. Use this operator to create script that produces Idoc Script for a resource include. |
<$"<$include " & VariableInclude & "$>"$>
evaluates to:
<$include VariableName$> |
like | The string comparison operator compares two strings.
|
|
| | The string inclusion operator separates multiple options, performing a logical OR function. | Evaluates to TRUE:
<$if "car" like "car|truck|van"$> |
For example, to determine whether the variable a has the prefix car or contains the substring truck, this expression could be used:
<$if a like "car*|*truck*"$>
Important:
To perform advanced string operations, use strEquals, strReplace, or other string-related global functions. See "Strings" for a list.The like operator recognizes the following wildcard symbols:
Use the following numeric operators to perform arithmetic operations. These operators are for use on integers evaluating to integers or on floats evaluating to floats:
Use the following Boolean operators to perform logical evaluations:
Boolean operators evaluate from left to right. If the value of the first operand is sufficient to determine the result of the operation, the second operand is not evaluated.