There should be a "unique" option on sort . . .

Peter Haworth pete at lcsql.com
Wed Jan 8 18:24:09 EST 2014


I think that would be useful Jan, but it's pretty easy to put the unsorted
container into a different container then sort it so I'm not sure it's
worth your time and effort.
Pete

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, Jan 8, 2014 at 1:52 PM, Jan Schenkel <janschenkel at yahoo.com> wrote:

> Hi Mark et al,
>
> The 'sort' command should return the same content, not throw out chunks,
> that might be better as an extension to the 'filter' command.
> But your comment about how sort affects the original container made me
> wonder.
>
> So I took another look at the source for the 'sort' command in cmds.cpp,
> and it doesn't look that hard to add an 'into' clause.
> Putting the sorted data into another container is straightforward to add
> to MCSort::exec (done that for the 'filter' command).
> The hardest part is untangling the MCSort::parse spaghetti.
>
> If I find the time I might take a stab at it…
>
> Cheers,
>
> Jan Schenkel.
>
> =====
> Quartam Reports & PDF Library for LiveCode
> www.quartam.com
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."
>  (La Rochefoucauld)
>
> --------------------------------------------
> On Sat, 1/4/14, Mark Wieder <mwieder at ahsoftware.net> wrote:
>
>  Subject: Re: There should be a "unique" option on sort . . .
>  To: "How to use LiveCode" <use-livecode at lists.runrev.com>
>  Date: Saturday, January 4, 2014, 5:02 PM
>
>  > yes, or to only take the first
>  that matches the sort key if sorting by
>  > other than the full record.
>
>  I can see it being slightly useful in certain cases, but it
>  leaves me
>  feeling a bit queasy. I think it's unsettling enough that
>  the sort
>  command sorts in place instead of being a function that
>  returns a
>  sorted copy, and of course it's way too late to change that
>  now. So
>  deleting items from a dataset while sorting them seems one
>  more step
>  down that ladder. I do realize that you'd have to specify
>  "unique"
>  explicitly, but still... if it didn't mess with the original
>  data set
>  I'd be all over this.
>
>  --
>  -Mark Wieder
>   ahsoftware at gmail.com
>
>
> _______________________________________________
> 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