Re: Sorting search results - solution needed

2018-10-25 Thread Scott Seward via use-livecode
Hey guys, thanks for all the possible solutions. I'm sure somewhere in here I'll get it to do what I need. Special thanks to those that wrote code. Much appreciate it! Scott On 10/24/18, 1:28 PM, "use-livecode on behalf of Niggemann, Bernd via use-livecode" wrote: here is my take,

Re: Sorting search results - solution needed

2018-10-24 Thread Niggemann, Bernd via use-livecode
here is my take, clumsy and not respecting all formatting requirements Instead of 187.1 187.1.1 187.1.2 187.3 187.22 187.33 187.234 it sorts 187.1 187.1.1 187.1.2 187.22 187.234 187.3 187.33 Kind regards Bernd --- on mouseUp put field

Re: Sorting search results - solution needed

2018-10-24 Thread Geoff Canyon via use-livecode
I think this comes pretty close to the requirement. It breaks the lines down into numeric/not numeric items, and then sorts from the least significant (rightmost) to most significant items. For each sort, sorts first by alpha, then numeric. That results in letters being sorted before numbers,

Re: Sorting search results - solution needed

2018-10-24 Thread Bob Sneidar via use-livecode
I should have said, in the loop keep adding a character until the value is no longer a number, then sort numeric by the last value. Bob S > On Oct 23, 2018, at 14:14 , Bob Sneidar via use-livecode > wrote: > > This of course cannot be a numeric sort. I would create a loop and start with >

Re: Sorting search results - solution needed

2018-10-24 Thread hh via use-livecode
As Craig said, your rules are not consistent to standards: You sort *after* the first period numeric with the exception that leading zeros are "valid". That's why the replace in the following function is needed. This now yields exactly your custom sort order: function gregSort s set itemdel

Re: Sorting search results - solution needed

2018-10-23 Thread dunbarxx via use-livecode
I am missing the rules of the game. But in any event I agree that the only way to sort a mixed bag of numbers, punctuation and alpha chars is to pre-parse and sort repeatedly by items, or some other, er, sort of chunk. But I do not see the "hierarchy" among spaces, periods, decimal numbers, etc.

Re: Sorting search results - solution needed

2018-10-23 Thread Bob Sneidar via use-livecode
Okay I misunderstood. So were it not for the multiple periods in a single value, you could have sorted numeric by word 1 of each, then resorted alphabetically by word 2 of each. The wrench in the works is the double periods. For this you can write a function that builds a string for a value

Re: Sorting search results - solution needed

2018-10-23 Thread Bob Sneidar via use-livecode
Come to think of it no. I didn't notice the items further down in the list with multiple periods. Your problems is very basic: You really have alpha-numeric data, which you are trying to sort numerically. It's a contradiction in terms. Looking at the nature of your data, and assuming your data

Re: Sorting search results - solution needed

2018-10-23 Thread Scott Seward via use-livecode
Hmm, interesting. I'll noodle on that. I also see my email is pretty unreadable without any formatting. Here is a slightly better data example. Alpha sort 187 187.01 187.02 187.1 187.22 187.234 187.3 187.33 187.456 10187 18700 187 (a) 187 (a)(1) 187 (b) 187 (b)(1) 187.1.1 187.1.2 187.c 187a 187c

Re: Sorting search results - solution needed

2018-10-23 Thread Bob Sneidar via use-livecode
sort lines numeric by word 1 of each > On Oct 23, 2018, at 12:22 , Scott Seward via use-livecode > wrote: > > Hi, > > I need to sort the result set of a search. But the common sort mechanisms I’m > familiar with won’t get me where I need. I’m sure this is a common problem > and much better

Re: Sorting search results - solution needed

2018-10-23 Thread Kee Nethery via use-livecode
I’d deconstruct the values into separate items and then sort by the last item, then next to last, eventually getting to the first. Kee Nethery > On Oct 23, 2018, at 12:22 PM, Scott Seward via use-livecode > wrote: > > Hi, > > I need to sort the result set of a search. But the common sort

Sorting search results - solution needed

2018-10-23 Thread Scott Seward via use-livecode
Hi, I need to sort the result set of a search. But the common sort mechanisms I’m familiar with won’t get me where I need. I’m sure this is a common problem and much better developers then I know the name of it and how to execute it in Livecode. Any help would be appreciated. Here is the