Sorting Advice

stephen barncard stephenREVOLUTION2 at barncard.com
Mon Jan 9 23:48:35 EST 2012


I think one has to make multiple passes - the doc say for "sort container":

*The sort container command is a stable sort. This means that if the
sortKey for two items or lines is the same, sorting does not change their
order, so you can do two successive sorts to create subcategories within
the major sort categories.*
*
*
* Tip: To create a custom sort order, use the eachkeyword to pass each line
or item to a custom function. The valuereturned by the function is used as
the sort key for that line or item. Note that it is not currently possible
to debug custom sort functions, and doing so could make the IDE unstable.
It is recommended to use logging messages instead.*


On 9 January 2012 20:33, Marty Knapp <martyknapp at comcast.net> wrote:

> I have a list that I'm currently sorting as follows:
>
> --item 2 may be a word or a number
> --item 1 is a date
>
> sort the lines of myList by item 2 of each --sort any words alphabetically
> sort the lines of myList numeric by item 2 of each --sort the numbers (any
> words go to the top of the list in the order provided in the first step)
> sort the lines of myList dateTime by item 1 of each --sort by date
>
> While this gives me what I need, is there a faster way to do this?
>
> Thanks,
> Marty
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  <http://www.google.com/profiles/sbarncar>



More information about the use-livecode mailing list