Sort so that "Hello" is always before "hello"
hh at hyperhh.de
Fri May 19 15:44:24 CEST 2017
> 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
don't you need a second sort as 'primary' sort?
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.
But your ASCII-number-formula for uppercase/lowercase A-Za-z
ordering is really worth to go in a lib!
By the way, my "solution" is the following, that handles uppercase
char before lowercase char sorting for each char of the lines.
set the casesensitive to true -- secondary sort:
set the casesensitive to false -- primary sort:
More information about the use-livecode