Command Syntax
COMPARE(expression1, expression2{, justification})
Syntax Elements
expression1 is the first string for comparisonexpression2 is the second string for comparison
justification specifies how the strings are to be compared. "L" indicates a left justified comparison.
"R" indicates a right justified comparison. The default is left justification.
The function returns one of the following values:
-1 The first string is less than the second
0 The strings are equal
1 The first string is greater than the second
Example
A = "XY999" B = "XY1000" R1 = COMPARE(A,B,"L") R2 = COMPARE(A,B,"R") CRT R1,R2The code above displays 1 -1, which indicates that XY999 is greater than XY1000 in a left justified comparison and XY999 is less than XY1000 in a right justified comparison.
0 comments:
Post a Comment