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

hh hh at hyperhh.de
Fri May 19 09:44:24 EDT 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


Hi Thierry,

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!

Hermann

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:
  sort myContainer
  set the casesensitive to false -- primary sort:
  sort myContainer





More information about the use-livecode mailing list