sort by length of line (Weird)

dunbarx at dunbarx at
Mon Dec 12 20:18:26 EST 2011

I wanted a text sort. I see that LC resolves the length function as a number, the length of the line in question loaded into the local variable each. So a word with 10 chars is sorted before a word with 9 chars.

It is the loading of "each" that makes this correct, and sensible. Mark, you will agree if you think about it. It isn't a matter of LC being friendly, as I so glibly suggested.

Sorting numeric fixes the misunderstanding. I see, more and more, that this is proper behavior for LC, given the strict syntax of the function.

I'm OK with it.


-----Original Message-----
From: Bob Sneidar <bobs at>
To: How to use LiveCode <use-livecode at>
Sent: Mon, Dec 12, 2011 1:58 pm
Subject: Re: sort by length of line (Weird)

It is doing just that, only it's doing a text sort of the numbers:

He wants a NUMERIC sort of the numbers. Hence sort myVar numeric by the length 
of each

On Dec 12, 2011, at 11:56 AM, Mark Wieder wrote:

> OK - that's just weird. I see what's going on, but what I'd expect is what (I
> think) Craig expects - that I'd get a list of the strings sorted by their
> character lengths.

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription 


More information about the Use-livecode mailing list