Re: Sorting by item ... of each and item ... of each

2023-09-06 Thread Craig Newman via use-livecode
gt; Ralph DiMola > IT Director > Evergreen Information Services > rdim...@evergreeninfo.net > > -Original Message- > From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf > Of matthias rebbe via use-livecode > Sent: Saturday, September 02, 2023

RE: Sorting by item ... of each and item ... of each

2023-09-05 Thread Ralph DiMola via use-livecode
atthias_livecode_150...@m-r-d.de Subject: Re: Sorting by item ... of each and item ... of each Of course my "not working" sort code look like this set the itemdelimiter to ";" sort lines of tList numeric by item 3 of each and item 2 of each. > Am 03.09.2023 um 02:59

Re: Sorting by item ... of each and item ... of each

2023-09-05 Thread Craig Newman via use-livecode
I should have given better context. I one only sorts the same field numeric, one gets: 123 132 213 231 312 321 Which is correct given the list of whole numbers in question. The stable sort allows one to then sort by char 3 of each, to get the result in the “compound” sort below. So am I

Re: Sorting by item ... of each and item ... of each

2023-09-05 Thread Craig Newman via use-livecode
I may be simply misunderstanding… Since HC days, one could concatenate sort criteria using the “&” character, and obtain multiple stable sorts in one go. In LC as well, since given, in a field 1: 231 312 123 213 321 132 and in a button somewhere: on mouseUp get fld 1 sort it numeric

Re: Sorting by item ... of each and item ... of each

2023-09-03 Thread matthias rebbe via use-livecode
Hello Mark, thanks for explanation and also for your solution. I will try. Maybe i should get my book "regular expressions" from Jeffrey E.F.Friedl from the shelf and should finish reading it, so i could make use of regular expressions in Livecode more often. Regards, Matthias > Am

Re: Sorting by item ... of each and item ... of each

2023-09-03 Thread matthias rebbe via use-livecode
Thanks Panos, you are right. ;) While reading your answer i remembered that i have done this with 2 separate sorts. I really don't know how i thought to use by sortKey1 and sortKey2 But at least the script editor did not return an error. Should not work so late in the night. Matthias > Am

Re: Sorting by item ... of each and item ... of each

2023-09-03 Thread matthias rebbe via use-livecode
Thanks Phil, i will try. > Am 03.09.2023 um 07:22 schrieb Phil Davis via use-livecode > : > > I believe this works: > > on mouseUp >put fld 1 into tList >sort lines of tList by _sortKey(each) >put tList into fld 2 > end mouseUp > > > function _sortKey pLine >

Re: Sorting by item ... of each and item ... of each

2023-09-03 Thread Mark Waddingham via use-livecode
On 2023-09-03 10:26, panagiotis m via use-livecode wrote: Hello Matthias, I do not think that the syntax "sort by sortKey1 and sortKey2" is supported Heh technically it 'is' - and does do something but it won't be what you expected... So the syntax for sort in this case is: sort by

Re: Sorting by item ... of each and item ... of each

2023-09-03 Thread panagiotis m via use-livecode
Hello Matthias, I do not think that the syntax "sort by sortKey1 and sortKey2" is supported If you have multiple sortKeys, you have to do multiple sorts, for example, in your use case, this should work: set the itemdel to ";" sort lines of tList numeric by item 3 of each sort lines of tList

Re: Sorting by item ... of each and item ... of each

2023-09-02 Thread Phil Davis via use-livecode
I believe this works: on mouseUp     put fld 1 into tList     sort lines of tList by _sortKey(each)     put tList into fld 2 end mouseUp function _sortKey pLine     set the itemDel to ";"     return item 3 of pLine & ";" & item 2 of pLine end _sortKey I

Re: Sorting by item ... of each and item ... of each

2023-09-02 Thread matthias rebbe via use-livecode
Of course my "not working" sort code look like this set the itemdelimiter to ";" sort lines of tList numeric by item 3 of each and item 2 of each. > Am 03.09.2023 um 02:59 schrieb matthias_livecode_150...@m-r-d.de: > > Maybe i do not see the forest for the trees > > I have a tab