sort lines by length

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Sep 24 04:37:19 EDT 2014


On 24 Sep 2014, at 04:21, Mark Wieder <mwieder at ahsoftware.net> wrote:

> Dave-
> 
> Tuesday, September 23, 2014, 1:59:39 PM, you wrote:
> 
>> sort lines of fld 1 numeric by length(each)
> 
>> I think "numeric" is needed if the lengths can be over 9
>> characters. Otherwise it will do a text sort on the lengths.
> 
> See bug^H^Henhancement request 9910. This has bugged me for some time
> now. Is there ever a case when you'd want to sort alphabetically by
> length()?

Mark,

I have no strong opinion on this. The response to your request made some sense to me, as it would apply only to certain built-in functions that can only return a numeric value. So there would be some inconsistency, and also possible confusion if trying to sort on a custom function that *I know* always returns a numeric value, but the engine doesn't.

I guess one case when you might want to sort alphabetically on length() is when demonstrating the behaviour of the sort command. :-)

Cheers
Dave Cragg



More information about the use-livecode mailing list