Comparison Operator Symbol | Name |
== | compares operands |
<> | not equal to |
< | less than |
> | greater than |
<= | less than or equal to |
>= | greater than or equal to |
~ | contains |
!~ | does not contain |
like | like |
Description | Compare two operands to determine if the first operand is less than the second operand |
Syntax | result = operand1 < operand2 |
Remarks | The result of a comparison is True or False. The following rules are used to determine how the operands are compared. • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. • If either operand is Null, then the result is Null. |
Example | The following determines if the contents of the Salary field are less than 75000: FieldAt("/SOURCE/R1/Salary") < 75000 |
Description | Compare two operands to determine if the first operand is greater than the second operand |
Syntax | result = operand1 > operand2 |
Remarks | The result of a comparison is always True, False, or Null. The following rules are used to determine how the operands are compared. • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. • If one or both operands are Null, then the result is Null. |
Example | The following determines if the contents of the Salary field are greater than 75000: FieldAt("/SOURCE/R1/Salary") > 75000 |
Description | Compare two operands to determine if the first operand is less than or equal to the second operand |
Syntax | result = operand1 <= operand2 |
Remarks | The result of a comparison is always True, False, or Null. The following rules are used to determine how the operands are compared. • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. • If one or both operands are Null, then the result is Null. |
Example | The following determines if the contents of the Salary field are less than or equal to 75000. FieldAt("/SOURCE/R1/Salary") <= 75000 |
Description | Compare two operands to determine if the first operand is greater than or equal to the second operand |
Syntax | result = operand1 >= operand2 |
Remarks | The result of a comparison is always True, False, or Null. The following rules are used to determine how the operands are compared. • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. • If one or both operands are Null, then the result is Null. |
Example | The following determines if the contents of the Quantity field are greater than or equal to 5. FieldAt("/SOURCE/R1/Quantity") >= 5 |
Description | Compares a string with a regular expression pattern to see if the pattern is contained within the string. |
Syntax | result = string ~ "pattern" |
Remarks | The result of a contains comparison is always True or False. If the pattern is found, a True is returned. If not a False is returned. The advantage of this operator is that you can search for a particular string or pattern of data in a large field. If that string or pattern exists anywhere in the field, then some action can be taken on the whole field. Also, the option of matching a pattern, not necessarily a literal string, makes the matching capabilities far more flexible. This operator can process a regular expression as the pattern. It recognizes all special characters. If either operand is Null, the result is Null. Note: For information on regular expressions and special characters, see Regular Expressions. |
Example | The regular expression ".y.*" means any string containing any character followed by 'y' followed by any number of characters. This expression will test to see if that pattern exists in the string. If "abcxyzzy" ~ ".y.*" Then LogMessage("It's in there.") Else LogMessage("It's not in there.") End if This expression is True for any record where the Field7 contains the letter X somewhere in it. FieldAt("/SOURCE/R1/Field7") ~ "X" |
Description | Compares a string with a regular expression pattern to see if the pattern is NOT contained within the string. |
Syntax | result = string !~ "pattern" |
Remarks | The result of a contains comparison is always True or False. If the pattern is found, a False is returned. If not, True. The advantage of this operator is that you can search for a particular string or pattern of data in a large field. If that string or pattern does not exist anywhere in the field, then some action can be taken on the whole field. Also, the option of matching a pattern, not necessarily a literal string, makes the matching capabilities far more flexible. This operator can process a regular expression as the pattern. It recognizes all special characters. If either operand is Null, then the result is Null. Note: For information on regular expressions and special characters, see Regular Expressions. |
Example | The regular expression ".y.*" means any string containing any character followed by 'y' followed by any number of characters. This expression tests to see if that pattern exists in the string. If "Big test string" !~ ".y.*" Then LogMessage("It's not in there.") Else LogMessage("It's in there.") End if This expression is True for any record where Field7 does not contain the letters "CR" anywhere in it. FieldAt("/SOURCE/R1/Field7") !~ "CR" |
Description | Compare operands and returns a Boolean value based upon whether the comparison is True or not. The operands may be numerical or string values. |
Syntax | operand1 == operand2 |
Remarks | The result of this comparison operator is a Boolean value of True, or False. True returns a value of "-1", while False returns "0". The following rules are used to determine how the operands are compared: • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. Enclose strings in quotes ("string"). |
Example | To compare the contents of the "Account No" field and find each instance of the string "10024", use the following: FieldAt("/SOURCE/R1/Account No") == "10024" |
Description | Compares two operands to determine if the first operand is not equal to the second operand. |
Syntax | result = operand1 <> operand2 |
Remarks | The result of a comparison is always True, False, or Null. The following rules are used to determine how the operands are compared. • If both operands are numeric, then a numeric comparison is performed. • If either of the operands is a string value, then a string comparison is used. If one or both operands are Null, then the result is Null. |
Example | The following determines if the contents of the Items Ordered field is different than the contents of the Items Shipped field: FieldAt("/SOURCE/R1/Items Ordered")<>FieldAt("/SOURCE/R1/Items Shipped") |