Compare objects
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You can compare two object references for equality using
the equals operator (=), which checks if two object
references are actually referencing the same object. The object
references can be equal even if the object references have been
defined for different classes in the class hierarchy. If the two
object references are defined for different classes, they are also equal
if they are both set to the Unknown value (?).
Note: You can also perform the same object reference
comparison using the
Equals( ) method
on Progress.Lang.Object. For more information,
see Use the root class: Progress.Lang.Object.The following example demonstrates the use of the equal operator
using the two object references stored in rSuper and rSubClass:
|
The MESSAGE statement will indeed be executed, demonstrating
that rSuper and rSubClass are
equal even though they reference different class types in the class
hierarchy.