There should be a "unique" option on sort . . .
janschenkel at yahoo.com
Wed Jan 8 22:52:16 CET 2014
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…
Quartam Reports & PDF Library for LiveCode
"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
feeling a bit queasy. I think it's unsettling enough that
command sorts in place instead of being a function that
sorted copy, and of course it's way too late to change that
deleting items from a dataset while sorting them seems one
down that ladder. I do realize that you'd have to specify
explicitly, but still... if it didn't mess with the original
I'd be all over this.
ahsoftware at gmail.com
More information about the use-livecode