Compare( ) method (Collections)
- Last Updated: March 15, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns a value, after comparing two objects, indicating if the first object is less than, equal to, or greater than the second object.
Return type: INTEGER
Access: PUBLIC
Applies to: Progress.Collections.IComparer<T> interface
Syntax
|
- object1
- The first object to compare.
- object2
- The second object to compare.
Notes
- The following rules apply when comparing the objects:
- If the returned value is less than 0 (zero), then object1 sorts before object2.
- If the returned value equals 0 (zero), then both objects occupy the same position in the sort order.
- If the returned value is greater than 0 (zero), then object1 sorts after object2.
- The handling of the unknown value (
?) as an input parameter is not dictated by this contract. Normally, comparing the unknown value (?) with any reference type is allowed and does not generate an exception. For reference, in ABL, the unknown value (?) is considered to be less than any reference that is valid, that is, the unknown value (?) sorts lower.
See also
<T> Generic type reference, CompareTo( ) method (Collections)