Paul.
I see you have come to the dark side. Welcome.
“Sort", and its newly reborn compound variant, works fine as "sort it ascending
numeric by word 1 of each && word 2 of each && word 3 of each”
Since “lines” are the default, all one needs, and I mentioned this on the
forum, is to determine t
On 4/5/2022 10:58 AM, Craig Newman via use-livecode wrote:
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,
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 t
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
so
Time to check the forum. Bernd has made a very significant contribution.
https://forums.livecode.com/viewtopic.php?f=9&t=36893
> On Apr 5, 2022, at 12:43 AM, Dick Kriesel via use-livecode
> wrote:
>
>
>> On Mar 30, 2022, at 2:16 PM, Paul Dupuis via use-livecode
>> wrote:
>>
>> sort lines o
> On Mar 30, 2022, at 2:16 PM, Paul Dupuis via use-livecode
> wrote:
>
> sort lines of tText by word 1 of each & word 2 of each & word 3 of each
Hi, Paul.
The only feature missing is padding the first two words:
sort tText by pad( word 1 of each ) & pad( word 2 of each ) & word 3 of each
Hmmm.
It isn’t that the “D” is concatenated onto the “ABC, (that would never happen)
but rather that the word ”ABC” comes before “AB”, but only if there is a second
word in each line:
ABC
AB
Sorts to
AB
ABC
———
BUT:
ABC XXX
AB XXX
sorts to:
ABC XXX
AB XXX
Not sure I get this.
Crai
On 3/30/2022 4:39 PM, Craig Newman via use-livecode wrote:
Paul
I just reread your earlier post. Did you mean concatenating as if each line
became a single long word? That would never do, of course, and is not how the
line of code works.
This is what I was referring to:
Input data: (note
Maybe this is easier to read:
ABC XYZ GGG
ACB XYZ GHH
ABC XYZ DEF
AAB XYZ GGG
AAC XYZ GHH
AAA XYZ DEF
gives
AAA XYZ DEF
AAB XYZ GGG
AAC XYZ GHH
ABC XYZ DEF
ABC XYZ GGG
ACB XYZ GHH
Each word is sorted in a stable way. The first word takes overall precedence.
The second word takes se
Paul
I just reread your earlier post. Did you mean concatenating as if each line
became a single long word? That would never do, of course, and is not how the
line of code works.
Craig
> On Mar 30, 2022, at 4:26 PM, Paul Dupuis via use-livecode
> wrote:
>
> On 3/30/2022 4:13 PM, Craig Newma
Paul.
So if you had the following list of words:
Ant Bat Chicken
Ash Arc Baton
Abacus aardvark Ax
Axle Apron Allspice
Africa Amazing Club
and ran the same line of code, you would get:
Abacus aardvark Ax
Africa Amazing Club
Ant Bat Chicken
Ash Arc Baton
Axle Apron Allspice
Is this wha
On 3/30/2022 4:13 PM, Craig Newman via use-livecode wrote:
A way I have always used was developed back in the HC days. Assuming you have your
list in the variable “yourList"
sort lines of yourList by word 1 of each & word 2 of each & word 3 of each
I used single letters as an example, but m
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 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 ta
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
> wrote:
>
> A B C
> A A B
> A B A
> A A
A way I have always used was developed back in the HC days. Assuming you have
your list in the variable “yourList"
sort lines of yourList by word 1 of each & word 2 of each & word 3 of each
Nothing shows off the stable sort power of either HC or LC like that.
Craig
> On Mar 30, 2022, at 3:39
On 3/30/22 12:39, Paul Dupuis via use-livecode wrote:
Is this "correct"? This is what the dictionary entry is referring to as
a "stable sort"?
That's correct. Here's something I do to sort the executionContexts:
# display grouped by object, then handler, then by line number and depth
sort num
Hello,
I need a little help today wrapping my mind around something simple in
LiveCode.
sort [{lines | items} of] container [direction] [sortType] [by sortKey ]
I have 3 columns of tab and cr delimited data. For example:
A B C
A A B
A B A
A A A
A A C
If I want to sort by col 1, then 2, then
17 matches
Mail list logo