IObject: Equals

Equals

Returns a boolean indicating the equality of this instance versus the passed in value.



 Public Function Equals(
	  ByRef Value As Variant ) As Boolean

Parameters

Value
[ByRef] Variant. The value to compare this instance against for equality.

Return Values

Boolean -  Boolean indicating the equality of this instance and the value.

Remarks

This should be overridden to provide the type of equality checking that is appropriate for each class. Most classes simply check to see if the value is the same object instance as this object, meaning, they are both the same object in memory. cDateTime checks to see if the value has the same date as this instance, and TimeSpan checks to see if the value has the same number of milliseconds as this instance to determine equality.

This method should not throw an exception if the wrong datatype is supplied. Instead, it should just return False to indicate that the value is not equal to this object instance.

What should Equals when
What should Equals return whenReturns
Two Variables Point to the same objectTrue
Two objects represent the same internal valueTrue

See Also

Project VBCorLib Overview Class IObject Overview IObject Properties IObject Methods GetHashCode