sort by length of line (Weird)

Ken Ray kray at sonsothunder.com
Mon Dec 12 17:27:46 EST 2011


On Dec 12, 2011, at 1:56 PM, 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.
> 
> Is there *any* use case in which you'd want strings sorted by the alphabetic
> representations of their lengths? I can't think of any.
> 
> To my mind, the "length" modifier should automatically force a numeric sort.

Actually Mark, I think LC is just seeing "the length of each" the same as "length(each)" which is the same as doing a sort by a custom function - ("sort tData by MyFunc(each)"). 

Regardles, though, I agree with you - LC should probably have more "smarts" about  sorting by functions that the engine already *knows* return a numeric result…

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the Use-livecode mailing list