On 12/29/06 12:14 AM, Robert Woodhead at [EMAIL PROTECTED] wrote:

> For example, if myClass has 3 properties a,b and c, each from 0-99,
> and I wanted to sort in ascending order of a,b and c, then I'd do
> something like this:

This is a great tip. I had forgotten that SortWith was added to the
language.

The only modification I'd make to your code is, if possible, cache the
sorting data within a property of the class so it does not have to be
recalculated during each sort. So this:

    sortArray(i) = 10000 * myClassArray(i).a + 100 * myClassArray
(i).b + myClassArray(c)

Would become this:

    sortArray(i) = myClassArray(i).SortData

I'd bet that would make a measurable difference if you had thousands of
objects to sort.

__________________________________________________________________________
Kem Tekinay                                                 (212) 201-1465
MacTechnologies Consulting                              Fax (914) 242-7294
http://www.mactechnologies.com                        Pager (917) 491-5546

  To join the MacTechnologies Consulting mailing list, send an e-mail to:
           [EMAIL PROTECTED]








_______________________________________________
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