realbasic-nug
[Top] [All Lists]

Re: How do you sort Object arrays?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How do you sort Object arrays?
From: John Kubie <jkubie at mac dot com>
Date: Fri, 29 Sep 2006 20:06:54 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C491F54F-2391-4E85-B2D1-6F856F4ADF15 at mobleybros dot com> <561CF0CA-F9FA-4A8E-A730-5B65B25E58EB at mac dot com>
I knew I should have thought about it a bit more. My method will fail if there are multiple objects with identical sort elements; adding a second one to the dictionary will erase the first. Before adding an element you could test the dictionary, but I'm not sure what you'd do then. It may depend on what you want to use the sort for.


On Sep 29, 2006, at 8:00 PM, John Kubie wrote:

1. In parallel with the object array, make a 1-dimensional array of the variable you want to sort on. 2. make a dictionary with paired elements: 1-dimensional array element -- associated object

_______________________________________________
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>


<Prev in Thread] Current Thread [Next in Thread>