Sorting marked cards
David Squance
squance at elkvalley.net
Tue Jun 22 10:35:02 EDT 2004
>--- David Squance <squance at elkvalley.net> wrote:
>> I have a stack with a number of active cards and a
>> few 'spares' which are
>> like templates. The active cards are marked. I
>> have a button which sorts
>> the cards by a particular field (empty on the
>> spares). The sort button is
>> expected to only sort the active cards--the script
>> says "sort marked cards
>> ...." The docs say "The sort command is a stable
>> sort. This means that if
>> the sortKey for two cards is the same, sorting does
>> not change their order
>> ...." Does this not apply to the mark property?
>> The cards with the empty
>> sort field are coming first, which is not what I
>> want.
>> Dave
>>
>
>Hi Dave,
>
>I think the engine is evaluating this alphabetically,
>where 'false' is smaller than 'true' -- try sort
>descending.
>
>Hope this helped,
>
>Jan Schenkel.
Thanks for the reply. I did use descending, but then the 'active' cards
are in the reverse order to what I want. Mainly, I asked because I was
wondering about the mark(ed) property and whether or not it was supposed to
be considered in a sort. IOW, is there any difference between
sort stack "xxx" by fld "whatever" and
sort marked cards of stack "xxx" by fld "whatever"
I've used a hidden fld to sort by to work around it.
Dave
More information about the use-livecode
mailing list