> Richmond wrote:
> Sorry about the asterisks . . .
> That is what happens when one copy-pastes directly from the LiveCode 
> scriptEditor into Thunderbird.

Specify the default character encodings for sending and receiving messages
Menu location: Thunderbird > Preferences > Display > Formatting - Advanced 
button

@Sort by length

As several others said:
     sort str [ascending|descending] numeric by length(each)
works perfectly.

But the first part of your script sorts correctly numeric by length if and only 
if
there is NO COMMA in the string to sort ... You sort by item 2, of course you 
could
sort by item -1.

Nevertheless the one-liner above will be *much* faster.

> Richmond wrote:
> on mouseUp
>   put empty into rSortByLength
>   put fld "CL" into tText
>   repeat for each word tLine in tText
>     put tLine&"," &the length of tLine&return after rSortByLength
>   end repeat
>   delete char -1 of rSortByLength
>   sort lines of rSortByLength descending numeric by item 2 of each
>   put empty into fld "CL"
>   put rSortByLength into fld "CL"
>   --
>   put 1 into KOUNT
>   repeat until line KOUNT of fld "CL" is empty
>     delete the last char of line KOUNT of fld "CL"
>     delete the last char of line KOUNT of fld "CL"
>     add 1 to KOUNT
>   end repeat
> end mouseUp

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to