Progress
Language Reference
COMPARE Function
The COMPARE function, which compares two strings, lets you:
COMPARE returns a value of type LOGICAL, which corresponds to the truth value of the comparison.
SYNTAX
operand1
A CHARACTER expression that evaluates to the first string to be compared.
relational-operator
A CHARACTER expression that evaluates to one of the relational operators, which are:
LT (or <), LE (or <=), EQ (or =), GE (or >=), GT (or >), and NE (or <>)
operand2
A CHARACTER expression that evaluates to the second string to be compared.
strength
A CHARACTER expression that evaluates to one of the following:
RAW
Causes Progress to compare each pair of characters using the numeric values in the current code page.
CASE-SENSITIVE
Causes Progress to perform a case-sensitive comparison of each pair of characters using the numeric values in the collation table-that is, either the collation table specified in collation, or else the collation table of the client.
CASE-INSENSITIVE
Causes Progress to perform a case-insensitive comparison of each pair of characters using the numeric values in the collation table- that is, either the collation table specified in collation, or else the collation table of the client.
collation
A CHARACTER expression that evaluates to the name of a collation table.
If strength evaluates to CASE-SENSITIVE or CASE-INSENSITIVE, the collation table that collation evaluates to must reside in the
convmap.cp
file and must be a valid collation table for the code page corresponding to the -cpinternal startup parameter.If strength evaluates to CASE-SENSITIVE or CASE-INSENSITIVE and collation does not appear, Progress uses the collation table.
NOTES
- If either or both operands evaluate to the UNKNOWN value (?), COMPARE returns the value indicated Table 13:
- COMPARE returns the UNKNOWN value (?) if one of the following occurs:
- relational-operator does not evaluate to a valid value.
- strength does not evaluate to a valid value.
- collation does not evaluate to a collation table residing in the
convmap.cp
file.- collation evaluates to a collation table that is not defined for the code page corresponding to the -cpinternal startup parameter.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |