Find backwards

25 views
Skip to first unread message

parttimeprogrammer

unread,
Oct 25, 2024, 5:58:05 PM10/25/24
to SuperCard Discussion
I've been struggling to come up with an efficient way to find a value in a field in reverse order. i.e. we're displaying card 550 and want to go to the previous card that contains a particular value in a particular field, as opposed to the next card that contains said value, for which we can simply use the "find" command.

Does anyone know of an xcmd that might exist for this, or have another trick?

Appreciate any help. Thanks!
Henk

MARK LUCAS

unread,
Oct 26, 2024, 3:46:09 PM10/26/24
to 'MARK LUCAS' via SuperCard Discussion
This is just off the top of my head, but one strategy might be to sort the searched window on the fly based on a hidden field. On modern Macs with solid state drives this is surprisingly quick, since it typically doesn't require shuffling around much data.

So for example if you added an invisible field that held each card's number, I think you should be able to quickly invert the effective 'card search order' used by find by sorting ascending or descending numeric on that field.

YMMV…

-Mark

parttimeprogrammer

unread,
Oct 26, 2024, 5:06:00 PM10/26/24
to SuperCard Discussion
Thanks, Mark! I had considered that. But the user is already able to sort the cards in custom sequences based on contents of fields and other criteria, so applying a different sort order to aid searching backwards makes it complex to revert to the original sequence after the backward search. For now I'm doing a repeat loop to check each previous card (without going there) for the searchtext in the searchfield. Currently there are about 1000 cards to search through, which doesn't cause a disagreeable lag, but the card count will increase about 3500 per year (they're order forms), so over time the delay will be irritating. Guessing I'm heading for a database.

Henk

Bill Bowling

unread,
Oct 26, 2024, 7:35:46 PM10/26/24
to superca...@googlegroups.com
Why not repeat downward by current card and use the offset or line offset 

Bill

On Oct 26, 2024, at 14:06, parttimeprogrammer <he...@nexgengrafix.com> wrote:

Thanks, Mark! I had considered that. But the user is already able to sort the cards in custom sequences based on contents of fields and other criteria, so applying a different sort order to aid searching backwards makes it complex to revert to the original sequence after the backward search. For now I'm doing a repeat loop to check each previous card (without going there) for the searchtext in the searchfield. Currently there are about 1000 cards to search through, which doesn't cause a disagreeable lag, but the card count will increase about 3500 per year (they're order forms), so over time the delay will be irritating. Guessing I'm heading for a database.
--
You received this message because you are subscribed to the Google Groups "SuperCard Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supercard-tal...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/supercard-talk/1ac70497-3705-4727-b776-0df2ebf836b5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages