Sort so that "Hello" is always before "hello"
hh at hyperhh.de
Thu May 18 18:29:46 EDT 2017
> 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 multiple "each" are no problem. "Each" points simply to the current line.
But because lower(a-zA-Z) is _always_ not equal to upper(a-zA-Z) you mean probably
set the casesensitive to false -- is default, just to be clear here
sort theData by each & \
( charToNum(char 1 of each) <> charToNum(lower(char 1 of each)) )
Then you have (each & "false") if char 1 of each is an upper case what comes
in the ascending order before (each & "true").
[But this will be, TMHO, usually a bit slower than multiple sorts].
More information about the Use-livecode