sort by length of line

Mark Schonewille m.schonewille at economy-x-talk.com
Sun Dec 11 23:52:07 EST 2011


Hi Craig,

sort lines of myList by length(each)
sort lines of myList by the length of each
sort lines of myList by number of chars of each

"Each" is simply the element that's currently being sorted, as if you put a repeat loop into one line of syntax.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Become our partner in sales http://qery.us/1bq Start selling Color Converter today. 20% commission!

On 12 dec 2011, at 05:04, dunbarx at aol.com wrote:

> Sorry, should have made a new thread.
> 
> I can do this the long way, but is there a clever sortkey that will sort lines by the length of those lines?
> 
> In other words, if I have a variable myVar with:
> 
> aaaaaaa
> xxx
> bbbb
> 
> I want to write something like:
> 
> sort myVar by the length of each
> 
> to yield:
> 
> xxx
> bbbb
> aaaaaaa
> 
> Thanks,
> 
> Craig Newman





More information about the Use-livecode mailing list