sort by length of line (Weird)

Pete pete at mollysrevenge.com
Tue Dec 13 12:05:05 CST 2011


I think Mark's point is specifically to do with the length function which
can only return a numeric value.  The suggestion is that the sort command
should be smart enough to know that and automatically use a numeric sort
(unless overridden) since it's not possible for text data to be produced.
 I assume the enhancement request applies to any function that is only
capable of returning a numeric value used in a sort statement, kinda like
your ADD example.
Pete

On Tue, Dec 13, 2011 at 9:26 AM, Bob Sneidar <bobs at twft.com> wrote:

> 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
>
>
> _______________________________________________
> 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
>
>


-- 
Pete
Molly's Revenge <http://www.mollysrevenge.com>


More information about the use-livecode mailing list