SORT by length

Richmond Mathewson richmondmathewson at gmail.com
Tue Aug 8 04:46:38 EDT 2017


Sorry about the asterisks . . .

That is what happens when one copy-pastes directly from the LiveCode 
scriptEditor into
Thunderbird.

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



Richmond.



More information about the use-livecode mailing list