[comp.sys.mac.hypercard] rapid index access

borton@net1.ucsd.edu (Chris Borton) (11/02/87)

In article <2017@umd5.umd.edu> zben@umd5 (Ben Cranston) writes:
>                                    Making the button go to the ID of the
>first card and search from there seems faster, but I might end up with a
>full index-sequential structure, with the index card pointing to all the
>"year header" cards, each of those pointing off to 12 "month header" cards.
>Lots of work for the setup, which already takes several hours...

This is a big version of what I ended up doing for my 'Enhanced Address' stack.
I took the Address stack and added a index-card directory, where clicking on a
letter goes to the first card beginning with that letter.  [I too first did a
binary search and gave up (on <50 cards!)]

I have 26 'index' cards that I try to keep invisible.  My solution has been to
kludge the Next and Prev arrows to look at the card they are going to, and if
it is an index card then send mouseUp to {Next,Prev} of the next card in that
direction.

This works fine for smallish stuff.  It has the problem, however, that if
someone tries to click the arrow with more than 17 index cards between them and
the next data card, HC errors with 'Too much recursion'

What other solutions to such problems are there?

-cbb
Chris "Johann" Borton, UC San Diego	...!sdcsvax!net1!borton
					borton@net1.ucsd.edu
"Letztes Jahr in Deutschland, noch ein Jahr hier, en dan naar het Nederland!

kurtzman@pollux.usc.edu (Stephen Kurtzman) (11/02/87)

In article <4232@sdcsvax.UCSD.EDU> borton@net1.UUCP (Chris Borton) writes:
>
>I have 26 'index' cards that I try to keep invisible.  My solution has been to
>kludge the Next and Prev arrows to look at the card they are going to, and if
>it is an index card then send mouseUp to {Next,Prev} of the next card in that
>direction.
>
>This works fine for smallish stuff.  It has the problem, however, that if
>someone tries to click the arrow with more than 17 index cards between them
>and the next data card, HC errors with 'Too much recursion'
>
>What other solutions to such problems are there?

Chris. Make your index cards one background type, and your data cards
another. Then use the following scripts in your "Prev" and "Next" buttons,
respectively,

on mouseUp
  go to previous card of this background
end mouseUp

on mouseUp
  go to next card of this background
end mouseUp

This should obviate the need for examining the next card. If there is some
need to have these cards all have the same background, or your examination
process is too complex to render in this fashion, you can always replace
the "send mouseUp ..." with an iterative routine. It may not be as simple
to program, but it should use both time and space a little more efficiently.