Object Comparison
When comparing two DBO variables only references are compared to see if they refer to the same object. So only an equality or non-equality comparison is supported.
Syntax
object1 [ = ‖ EQ ‖ # ‖ NE ‖ <> ‖ >< ] object2
Applicability
Language and internal objects.
Comments
Comparison |
Result |
---|---|
Object = Non-Object |
Returns FALSE. |
Object = Object |
Returns TRUE if they both reference the same object. |
Object # Non-Object |
Returns TRUE |
Object # Object |
Returns TRUE if they reference different objects. |
All other object comparisons such as < and > generate the following fatal run time error: [B14] "Bad stack descriptor"
.
To compare the contents of two objects, an object-specific comparison method must be used where available.
Examples
Equality test on two objects:
IF Horse = Equine THEN ...
Inequality test on two objects:
IF Insect # Mammal THEN ...
Tests if the method Horse.SiredBy() returns a valid (non null) object. Note the use of the (object) cast.
Progenitor = Horse->SiredBy() IF Progenitor # (object)0 THEN ...