Sort question

Mike Bonner bonnmike at gmail.com
Sun Oct 3 10:39:39 EDT 2010


Changing the first suggestion

set the itemDel to slash
sort lines of myList by item 2 of (word 2 of each) and item 1 of (word 2 of
each)

to

set the itemDel to slash
sort lines of myList by item 2 of (word 2 of each) *&&* item 1 of (word 2 of
each)

works for this also as long as the data is always 2 digit format. Barring
that, just doing 2 consecutive numeric sorts on the appropriate key will
work.
Can you use the && version and specify sort type individually for each
part?
IE: sort blah blah by item 1 && item 2, 1 numeric, the other alphabetic?

On Sun, Oct 3, 2010 at 8:32 AM, Ben Rubinstein <benr_mc at cogapp.com> wrote:

> This is really the same as Mark suggested, but should work even if the
> numbers aren't zero padded:
>
> function sortByMonthAndDay tText
>   set the itemDelimiter to "/"
>   sort lines of tText ascending numeric by item 1 of (word 2 of each)
>   sort lines of tText ascending numeric by item 2 of (word 2 of each)
>   return tText
> end mouseUp
>
> (I think Mark probably meant "&" instead of "and")
>
> Ben
>
>
> On 03/10/2010 15:14, Yves COPPE wrote:
>
>>
>> Le 03-oct.-10 à 16:04, Mark Schonewille a écrit :
>>
>>  Hi Yves,
>>>
>>> What about this:
>>>
>>> set the itemDel to slash
>>> sort lines of myList by item 2 of (word 2 of each) and item 1 of (word 2
>>> of
>>> each)
>>>
>>>
>>>
>>
>> Re,
>>
>> No, I don't receive the right answer
>>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list