On Oct 2, 2006, at 8:11 PM, Phil M wrote:

The bigger issue with the a Compare() approach that it will remain rather limited until REALbasic provides some method to inspect properties of generic objects. You could implement a ComparableInterface but how would you specify which property to sort by?


You would not need to... you code it in the class implementing the interface...a simple example for a date property:


Function Compare(ObjToCompare as Comparable) as Integer
  Return MyClass(ObjToCompare).theDate.TotalSeconds _
         - me.theDate.TotalSeconds
End function


If 0 the two are equal, if < 0 ObjectToCompare is Greater If > that instance is greater

That is enough to allow a sort.

- Karen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to