sort by length of line (Weird)

Bob Sneidar bobs at twft.com
Tue Dec 13 12:26:21 EST 2011


I went to bed thinking about this. Think about what would have to happen for Livecode to conclude this needed to be a numeric sort: It would have to evaluate every line in the sort, and if it found just one line that was not a number, it would have to then use a text sort. What if the list was 10,000 lines long? Seems like a lot of overhead. What if the items were dates? What if they were mixed? 

So what the devs did it seems to me is said, "Everything is a text sort unless explicitly stated otherwise." That makes a lot more sense to me, because it's behavior is predictable. I cringe at commands and functions that change the way they behave based upon the nature of the data they are working with. 

You will say, "But doesn't the add command do just that?" To which I would reply, "Yes, but it's a command that can ONLY work with numbers." 

Bob


On Dec 12, 2011, at 6:08 PM, Mark Wieder wrote:

> Bob-
> 
> Monday, December 12, 2011, 3:56:31 PM, you wrote:
> 
>> It is doing just that, only it's doing a text sort of the numbers:
>> 1
>> 10
>> 100
>> 11
>> 12
>> etc.
> 
> Yes, and that's just wrong. I can think of no problem for which that
> is the solution.
> 
> -- 
> -Mark Wieder
> mwieder at ahsoftware.net
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list