Sorting Advice

Marty Knapp martyknapp at comcast.net
Tue Jan 10 12:10:19 EST 2012


OK, so I'm good. Just though I might be missing something. Thanks Stephen.

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




More information about the use-livecode mailing list