TCE条件表达式
Table 16-3. Conditional Expression Values
Type |
Description |
integer |
Specifies an integer in the format n; for example: 8
|
float |
Specifies a floating point decimal in the format n.n; for example: 5.021
|
string |
Specifies a string of characters surrounded by single quotation marks; for example: 'Mike'
|
date |
Specifies a year, month, and day in the format: {yyyy/mm/dd} You must specify four digits for the year and two digits for month and day; for example: {1968/10/03}
|
time |
Specifies the time in the following format: [hh:mm:ss:mmm] You must specify two digits for the hour, minutes, and seconds, and three digits for the milliseconds; for example: [01:45:37:025]
|
timestamp |
Specifies a timestamp in the following format: {yyyy/mm/dd-hh:mm:ss:mmm} You must specify four digits for the year; two digits each for the month, day, hour, minutes, and seconds; and three digits for the milliseconds; for example: {1968/10/03-01:45:37:025}
|
field |
Specifies a value derived from an object attribute or class constant in the format: $object-name.attribute-name or $object-name.class-constant-name object-name Specifies the object from which the attribute is taken. attribute-name Specifies the attribute from which the value is taken class-constant-name Specifies a class constant. Attributes and class constants are treated the same way throughout the Conditional subsystem. For example: $Person.Age
|
Table 16-4. Expression Comparison Operators
Expression |
Description |
= or = = |
equal to |
^= |
case-insensitive equal to |
!= |
not equal to |
< |
less than |
> |
greater than |
<= |
less than or equal to |
>= |
greater than or equal to |
Table 16-5. Conditional Subsystem Functions
Function |
Description |
INSTANCEOF |
The INSTANCEOF function tests whether one class (string1) is contained in the hierarchy of the class represented by string2. This function returns TRUE if string1 is the name of a class that is in the hierarchy of the class represented by string2, inclusive. If string2 is not a class, the function returns FALSE. For example, DPdrCre is contained in the DOdrCre class, and the value returned is TRUE. A(obj) := "$obj.Class INSTANCEOF 'DOdrCre'";
|
ISIN |
The ISIN and IISIN functions test whether one string is contained in another. For example, ell is contained in the string hello. $a.x contains hello. b(a) := 'ell' ISIN $a.x;
The ISIN function is case-sensitive; IISIN ignores the case of both strings. |
LIKE |
The LIKE and ILIKE functions test whether a given string matches the UNIX pattern in a second string. For more information on this function, see the information about the low_file_filter function in the Integrator Toolkit API Reference manual. |
INLIST |
INLIST and IINLIST provide easy ways to check for the occurrence of a string in a list attribute. The following example shows the use of the INLIST function: b(a) := 'Hello' INLIST $a.listattribute;
b(a) is TRUE if Hello is contained in the list attribute listattribute for object a. The string to check for may also be an object attribute. The INLIST function is case-sensitive; IINLIST ignores the case of both strings. |
INMLIST |
The INMLIST and IINMLIST functions provide access to name multivalue table attributes. The following example shows the use of the INMLIST function: b(a) := INMLIST($a.multitable, 'name1', 'value1');
b(a) is TRUE if the multitable named multitable in object a contains the name1 name with a value of value1. The result would be FALSE if name1 did not exist, or if name1 did exist but did not contain value1. The INMLIST function performs case-sensitive string comparisons for the name and value; IINMLIST ignores the case of both strings. |
STRCAT |
The STRCAT function concatenates strings in the condition processor. For example, STRCAT concatenates $e.DocumentDescription, the string '-Example-', and $o.DocumentDescription. It then compares the resulting string to the string 'Desc1-Example-Desc2'. ATest(o,e) := 'Desc1-Example-Desc2' = STRCAT
($e.DocumentDescription '-Example-'
$o.DocumentDescription);
|