sorting

dunbarx at aol.com dunbarx at aol.com
Sat Aug 9 09:59:13 EDT 2014


Way back from 1987, and undocumented everywhere except in the user notes in the dictionary here, is this;



Multiple stable sorts may be implemented directly by concatenating sortKeys:


sort container by sortKey1 & sortKey2 & sortKey3...


Sortkey order determines the sorting sequence


So you can:


sort lines of yourList by word 1 of each & word 3 of each


Craig Newman



-----Original Message-----
From: Alex Tweedly <alex at tweedly.net>
To: use-livecode <use-livecode at lists.runrev.com>
Sent: Sat, Aug 9, 2014 5:52 am
Subject: Re: sorting


Larry,
can you be more explicit about how it doesn't work ?

Actually, can you explain better what you want to do ? You said you want 
to sort by the 2nd and then the 3rd word - but gave an example that 
appeared to show sorting by 2nd and 1st - and not even have a 3rd word 
in any line.

So how about a slightly less terse description, and an example showing 
both "before" and "after" and hopefully we can get you to where you want 
....

-- Alex.


On 09/08/2014 09:14, larry at significantplanet.org wrote:
> Sorry, that doesn't work
>
> ----- Original Message ----- From: "Björnke von Gierke" <bvg at mac.com>
> To: "How to use LiveCode" <use-livecode at lists.runrev.com>
> Sent: Saturday, August 09, 2014 12:58 AM
> Subject: Re: sorting
>
>
>> sort theList by word 2 of each
>> sort theList by word 1 of each
>>
>> sort order is retained in-between commands, that's why it works.
>>
>> On 09 Aug 2014, at 08:24, larry at significantplanet.org wrote:
>>
>>> I have a field I want to sort.
>>> Each line has 4 words.
>>> I want to sort by the first word (ascending) and then do a 2nd sort 
>>> by the 3rd word without changing the order of the first word.
>>>
>>> Example:
>>>
>>> apple  box
>>> apple  pie
>>> apple  zoo
>>> baby  blue
>>> baby  rattle
>>> baby  zoo
>>> etc.
>>>
>>> TIA
>>> Larry
>>> _______________________________________________
>>> 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
>>
>>
>> _______________________________________________
>> 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 
>
>
> _______________________________________________
> 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


_______________________________________________
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

 




More information about the use-livecode mailing list