What VB6 method allows two custom objects of the same type (defined in a class module) to be compared to each other? I think there’s an equivalent to Java’s compareTo method, but I can’t find it anywhere.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For others who may be wondering about the same question:
After doing a lot of looking around, it seems like VB6 doesn’t have any kind of built-in
compareToorequalsmethods, like Java does.I forgot that in Java,
compareTois defined in thejava.lang.Comparableinterface. Since interfaces are so broken in VB6, even if you wrote your ownComparableinterface, you would have to call your object’sComparable_compareTomethod unless it was declared asComparable, which is pointless.Bottom line: if you want
compareToorequalsmethods in your VB6 classes, just put them in.