compare

POO ou Classe personnel

compare

Messagepar oguruma » 30 Jan 2005 à 12:46

Public Class BasicComparator As Comparator

' A simple comparators that compares variables of the same kind

Public Function compare(e1 As Variant, e2 As Variant) As Integer
' An object is always greater than non-objects.
' Two objects can not be compared to each other, yet. They always are equal.
compare = +1
If Isobject(e1) Then
If Not Isobject(e2) Then Exit Function
Else
compare = -1
If Isobject(e2) Then Exit Function
If e1 < e2 Then Exit Function
compare = +1
If e1 > e2 Then Exit Function
End If
compare = 0
End Function
End Class
Bien à vous

http://www.dominoarea.org/oguruma/

Les téléphones PORTABLES dans les TGV y en a MARRRE de ces voyageurs qui ne respectent pas les autres ! ARRET DES PORTABLES SVP - Merci

Fumeurs ! respectez les non fumeurs !!!
Fumeurs ! respectez la loi de février 2007 et les lieux publics !!! (ie. hall de gares)
Avatar de l’utilisateur
oguruma
Super V.I.P.
Super V.I.P.
 
Message(s) : 4086
Inscrit(e) le : 16 Déc 2004 à 08:50
Localisation : LILLE

Retour vers Programmation orienté objet