Description | Logical conjunction of two operands |
Syntax | result = operand1 And operand2 |
Remarks | The And operator determines the logical conjunction of the two operands by treating nonzero values as a value of True and zero values as False. |
Example | The following expression evaluates to True if the contents of field Salary are greater than 50000 and the field HomeOwner is false. FieldAt("/SOURCE/R1/Salary") > 50000 And Not FieldAt("/SOURCE/R1/HomeOwner") |
Operand 1 | Operand 2 | Result |
---|---|---|
True (nonzero) | True | True |
True | False (0) | False |
True | Null | Null |
False | True | False |
False | False | False |
False | Null | False |
Null | True | Null |
Null | False | False |
Null | Null | Null |
Description | Perform a logical disjunction on two expressions |
Syntax | result = expr1 Or expr2 |
Remarks | If either or both expressions evaluate True (nonzero), result is True (-1). To see how result is determined, see the Truth table following this table. |
Example | This expression evaluates both the ("Total Cost") field and the ("Zone") field. When using the Or operator, either condition can be true to return "Yes" to the target. If both criteria are false, then "No" is returned. The Trim Function is used to trim any leading or trailing spaces. The Val Function converts text data types into numeric values before mathematical evaluations are performed. See Trim, Trim$ Functions and Val Function. If Trim(Val(FieldAt("/SOURCE/R1/Total Cost")) >100000) Or Trim(FieldAt("/SOURCE/R1/Zone") Like "SW") Then "Yes" Else "No" End If |
Expression 1 | Expression 2 | Result |
True (nonzero) | True | True (-1) |
True | False (0) | True |
True | Null | True |
False | True | True |
False | False | False (0) |
False | Null | Null |
Null | True | True |
Null | False | Null |
Null | Null | Null |
Bit in Expression 1 | Bit in Expression 2 | Result |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Description | Negate a numeric expression |
Syntax | result = Not expr |
Remarks | The Not operator inverts the bit values of any variable. If an integer variable has the value 0 (False), the variable becomes -1 (True); if it has the value of -1, it becomes 0. |
Example | This example uses the Not operator to determine whether the value 1000 occurs in the source ("Field1"). Not(FieldAt("/SOURCE/R1/Field1") == 1000) |
Expression | Result |
True (nonzero) | False (0) |
False (0) | True (-1) |
Null | Null |
Bits in Expression | Bit in Result |
0 (zero) | 1 |
1 | 0 (zero) |
Description | Compare two string expressions |
Syntax | result = expression Like pattern |
Remarks | If expression matches pattern, result is True (-1); if there is no match, result is False (0); and if either expression or pattern is a Null, result is also a Null. The default string-comparison method is Binary. Built-in pattern matching provides a versatile tool for string comparisons. The pattern-matching features allow you to use wildcard characters, like those recognized by the operating system, to match strings. For the wildcard characters you can use and the number of digits or strings they match, see the table following this one. |
Example | This illustrates how Like is used in an expression when the data you want to match in a particular field does not occupy the entire field. In this case, the "Equal to" (==) comparison operator does not produce the results you expect, so use the Like operator as follows: ("FIELD1") Like "No*" |
Characters in Pattern | Matches in Expressions |
? | Any single character |
* | Zero or more characters |
# | Any single digit (0 - 9) |
[charlist] | Any single character in charlist |
[^charlist] | Any single character not in charlist |
word1|word2|word3 | Any of the words on each side of the line (|) |
Number of Characters | Pattern | True | False |
---|---|---|---|
Multiple | "a*a" | "aa", "aBa", "aBBBa" | "aBC" |
Special | "a[*]a" | "a*a" | "aaa" |
Multiple | "ab*" | "abcdefg", "abc" | "cab", "aab" |
Single | "a#a" | "a0a", "a1a", "a2a" | "aaa", a10a" |
Range of characters | "[a - z]" | "f", "p", "j" | "2", "&" |
Outside a range | "[^a - z]" | "9", "&", "%" | "b", "a" |
Not a digit | "[^0 - 9]" | "A", "a", "&" | "0", "1" |
Combined | "a[^b - m]#" | "An9", "az0" | "abc", "a99", "aj0" |
Alternative branches | "yes|no" | "yes", yesterday", "no", "albino" | "nothing", "eyes", "know", "grayest" |