Description
Tests for equality between the supplied PBDOM_OBJECT and the PBDOM_ATTRIBUTE from which the method is invoked.
Syntax
pbdom_attribute_name.Equals(pbdom_object pbdom_object_ref)
Argument |
Description |
---|---|
pbdom_attribute_name |
The name of the PBDOM_ATTRIBUTE |
pbdom_object_ref |
A PBDOM_OBJECT to be compared |
Return value
Boolean.
Returns true if the current PBDOM_ATTRIBUTE is equivalent to the input PBDOM_OBJECT and false otherwise.
Throws
EXCEPTION_USE_OF_UNNAMED_PBDOM_OBJECT -- If this PBDOM_ATTRIBUTE does not have or has not been assigned a user-defined name.
EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE -- if the input PBDOM_OBJECT is not a reference to an object derived from PBDOM_OBJECT.
Examples
-
The following code uses the Equals method to test for equivalence between a referenced PBDOM_OBJECT and a cloned object.
pbdom_attr = Create PBDOM_Attribute pbdom_attr.SetName("My_Attr") pbdom_attr_clone = pbdom_attr.Clone(true) if (pbdom_attr_clone.Equals(pbdom_attr)) then MessageBox ("Equals", "Yes") else MessageBox ("Equals", "No") end if
The SetName method names the newly created PBDOM_ATTRIBUTE, which is subsequently cloned with the Clone method. The Equals method tests for equality between the cloned PBDOM_ATTRIBUTE pbdom_attr_clone and the referenced PBDOM_OBJECT pbdom_attr. A message box displays the result returned from the Equals method.
Note here that because a cloned object is never equivalent to the object from which it is cloned, the Equals method returns false.
-
The following code uses the Equals method to test for equivalence between two cloned objects.
pbdom_attr = Create PBDOM_Attribute pbdom_attr.SetName("My_Attr") pbdom_attr_clone = pbdom_attr.Clone(true) pbdom_attr_2 = pbdom_attr_clone if (pbdom_attr_clone.Equals(pbdom_attr_2)) then MessageBox ("Equals", "Yes") else MessageBox ("Equals", "No") end if
A newly created PBDOM_ATTRIBUTE is cloned, and a reference to this clone is assigned to pbdom_attr_2. The Equals method tests for equality between the cloned PBDOM_ATTRIBUTE pbdom_attr_clone and the reference to it, pbdom_attr_2. A message box displays the result returned from the Equals method.
Here the Equals method returns true.
Usage
Note that the clone of a PBDOM_ATTRIBUTE is not considered equal to itself.