Comparing VB6 Objects

What VB6 method allows comparing two user objects of the same type (defined in the class module) with each other? I think the equivalent of the Java method is compareTo, but I cannot find it anywhere.

+5
source share
2 answers

For others who may be wondering about the same question:

After repeated searches, it looks like VB6 does not have any built-in methods compareToor equals, such as Java.

, Java compareTo java.lang.Comparable. VB6, Comparable, Comparable_compareTo, Comparable, .

: compareTo equals VB6, .

+1

"" " ?", TypeName:

If (object1 <> Nothing) and (object2 <> Nothing) then
  If (TypeName(object1) = TypeName(object2)) Then
    Debug.Print "object types are the same"
  Else
    Debug.Print "object types are NOT the same"
  End If
End If

"" " ?", Is:

If (object1 Is object2) Then
  Debug.Print "objects references are the same"
Else
  Debug.Print "objects references are NOT the same"
End If
+6

All Articles