Confirm sort container order...

Craig Newman craig at starfirelighting.com
Tue Apr 5 10:58:22 EDT 2022


Paul.

Certainly, and in the forum discussion your point, about the mainstream, recommended and “correct” way to sort was mentioned several times.

The discussion may seem academic to some, and perhaps pointless to others. But I like this sort of nonsense, and actually believe it is rather more than just that. In fact, it speaks to the internal working of the “sort” command itself, which seems counterintuitive at least, and a mystery at best.

I like LC mysteries. And there just might be something worthwhile to learn...

Craig

> On Apr 5, 2022, at 10:43 AM, Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> All those forum efforts (except Richard's) ignore that the dictionary entry states that the "sort" command is a stable sort precisely so that you can do multiple sorts to sort by multiple chunks
> 
> Whether you do
> 
>   sort lines of tText by word 3 of each
>   sort lines of tText by word 2 of each
>   sort lines of tText by word 1 of each
> 
> or
> 
> repeat from i = 3 down to 1
>   sort lines of tText by word i of each
> end repeat
> 
> and whether you want to sort by "word i of each" or "item i of each" or "token i of each" or whatever, the multiple sort commands is the LC recommended way to perform  multi-level sort.
> 
> 
> On 3/30/2022 4:16 PM, Craig Newman via use-livecode wrote:
>> I hate that one cannot edit previous posts here like we can on the forum.
>> 
>> I meant “tabs”. not “tase”.
>> 
>> Craig
>> 
>>> On Mar 30, 2022, at 4:15 PM, Craig Newman <craig at starfirelighting.com> wrote:
>>> 
>>> I am assuming here that there are spaces separating the chars in your list. The use of “words” will also delimit if those are tase instead of spaces. But the method is worth exploring…
>>> 
>>> Craig
>>> 
>>>> On Mar 30, 2022, at 3:39 PM, Paul Dupuis via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> wrote:
>>>> 
>>>> A B C
>>>> A A B
>>>> A B A
>>>> A A A
>>>> A A C
>> _______________________________________________
>> 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