Re: Sort so that "Hello" is always before "hello"

2017-05-19 Thread hh via use-livecode
Thierry, out of interest, for a lazy day: Have you ever thought of a sort function of type sort by replaceText(each,...) ? Must have a series of really good applications. For example if one wishes, not for the container, but for the sort only, to exchange several chars. Hermann ___

Re: Sort so that "Hello" is always before "hello"

2017-05-19 Thread Thierry Douez via use-livecode
​Hallo Hermann, ​ > >> sort lines of T numeric by each & AaZz_sort( each) ? >> sort lines of T >> >> Else the container is sorted by the first char of each line only. >> > > ​Ok, I can't find a way to do it with a single sort. Therefore your solution 1st or mine adding a second sort after it. En

Re: Sort so that "Hello" is always before "hello"

2017-05-19 Thread Thierry Douez via use-livecode
2017-05-19 15:44 GMT+02:00 hh ​: > Thierry wrote: > > sort lines of T numeric by AaZz_sort( each) > > function AaZz_sort x > >get chartonum( char 1 of x) > >if IT > 96 then return ( IT - 96) * 2 + 1 > >else return ( IT - 64) * 2 > > end AaZz_sort > > > Hi Thierry, > > don't you need a

Re: Sort so that "Hello" is always before "hello"

2017-05-19 Thread hh via use-livecode
> Thierry wrote: > sort lines of T numeric by AaZz_sort( each) > function AaZz_sort x >get chartonum( char 1 of x) >if IT > 96 then return ( IT - 96) * 2 + 1 >else return ( IT - 64) * 2 > end AaZz_sort Hi Thierry, don't you need a second sort as 'primary' sort? sort lines of T numer

Re: Sort so that "Hello" is always before "hello"

2017-05-19 Thread Thierry Douez via use-livecode
A slight variation from Hermann's code, working *only* with ASCII: sort lines of T numeric by AaZz_sort( each) function AaZz_sort x get chartonum( char 1 of x) if IT > 96 then return ( IT - 96) * 2 + 1 else return ( IT - 64) * 2 end AaZz_sort I can explain if someone is asking for...

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread hh via use-livecode
Correction, sorry. > I wrote: > But because lower(a-zA-Z) is _always_ not equal to upper(a-zA-Z) ... This handles only one case of casesensitivity. Should read: If the casesensitive is true then lower(a-zA-Z) is _always_ not equal to upper(a-zA-Z) If the casesensitive is false then lower(a-zA-Z

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread hh via use-livecode
> Richard E.H. wrote: > ... the possibility of something like > > sort lines of theData by word 1 of each & \ > (lower(char 1 of each) <> upper(char 1 of each)) > > But I don't think I can use multiple each's like that, can I? Your approach is to use a sort function, a powerful tool. The mu

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Kaveh Bazargan via use-livecode
Brilliant, thank you. I have tried to fall out of love with LiveCode but it is hard! I used HyperCard since pre-release version ;-) On 18 May 2017 at 22:28, hh via use-livecode wrote: > You want a sort with co-sort: > > set the casesensitive to true -- secondary sort: > sort myContainer > set t

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Dr. Hawkins via use-livecode
On Thu, May 18, 2017 at 2:43 PM, hh via use-livecode < use-livecode@lists.runrev.com> wrote: > on mouseUp > set the casesensitive to true -- secondary sort: > sort myContainer > set the casesensitive to false -- primary sort: > sort myContainer > on mouseUp > Now *that* is clever. At fir

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Dr. Hawkins via use-livecode
On Thu, May 18, 2017 at 2:20 PM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > What you are wanting to do is a recursive function that sorts within each > word. If the first character is all you care about, it would be easy > enought to code, but if *every* character comes

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread hh via use-livecode
> Kaveh B. wrote: > I have the following lines when a list of words is sorted: Hello > hello Hello hello hello so there is no hierarchy between upper and > lower case chars. I want caps to go first. How do i do that pls? Let me explain a bit more. You want a sort with co-sort. LC allows this bec

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread hh via use-livecode
You want a sort with co-sort: set the casesensitive to true -- secondary sort: sort myContainer set the casesensitive to false -- primary sort: sort myContainer ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscr

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Bob Sneidar via use-livecode
What you are wanting to do is a recursive function that sorts within each word. If the first character is all you care about, it would be easy enought to code, but if *every* character comes into play, the problem becomes grossly complex. This isn't a sort problem. It's a filing order problem.

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Bob Sneidar via use-livecode
Then that is not a sort! Bob S > On May 18, 2017, at 14:13 , Kaveh Bazargan via use-livecode > wrote: > > Thanks Phil > > That works in the case I mentioned, but with different letters, All upper > case chars come to top, so I get: > > Goodbye > Hello > goodbye > hello > > What I need is

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Kaveh Bazargan via use-livecode
Thanks Phil That works in the case I mentioned, but with different letters, All upper case chars come to top, so I get: Goodbye Hello goodbye hello What I need is Goodbye goodbye Hello hello On 18 May 2017 at 18:19, Phil Davis via use-livecode < use-livecode@lists.runrev.com> wrote: > "set t

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Bob Sneidar via use-livecode
Oh right. I forgot about that. Still, I like my way better. ;-) Bob S > On May 18, 2017, at 13:30 , dunbarx via use-livecode > wrote: > > The "caseSensitive" is a global property. It can be set like any other. if > you do so before the "sort" command, the capital first letters precede the > l

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread dunbarx via use-livecode
The "caseSensitive" is a global property. It can be set like any other. if you do so before the "sort" command, the capital first letters precede the lower case. Craig -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Sort-so-that-Hello-is

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Bob Sneidar via use-livecode
doesn't look like there is a command to do this. Try creating an sqLite database in memory (or on disk it doesn't matter) called tempdata with a column called textdata, adding your words/items/lines to the database, then query the database with select textdata from template order by textdata.

Re: Sort so that "Hello" is always before "hello"

2017-05-18 Thread Phil Davis via use-livecode
"set the caseSensitive to true" before sorting. Phil Davis On 5/18/17 10:10 AM, Kaveh Bazargan via use-livecode wrote: I have the following lines when a list of words is sorted: Hello hello Hello hello hello so there is no hierarchy between upper and lower case chars. I want caps to go firs

Sort so that "Hello" is always before "hello"

2017-05-18 Thread Kaveh Bazargan via use-livecode
I have the following lines when a list of words is sorted: Hello hello Hello hello hello so there is no hierarchy between upper and lower case chars. I want caps to go first. How do i do that pls? -- Kaveh Bazargan Director River Valley Technologies @kaveh1000 +44 7771 824 111 www.rivervalleyte