🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #19947

Re: Hypercard question

#19947
From: Dan Freedman
Date: Mon, 05 Oct 1987 14:03
36 lines
2281 bytes
In article <29942@sun.uucp>, chuq%plaid@Sun.COM (Chuq Von Rospach) writes:
> ... but I'm not sure how to build a linked list of cards
> attached to a primary card.

Well, for any linked list, all you need is to store a pointer to the next
element somewhere in the current element.  In HyperCard, the "pointer" is
the card id of the next card (a number like '12345'),
and you may as well store it in a field on each card in your list (perhaps
called "next card").  You can make the card invisible by issuing the 'hide 
field "next card"' command in the message window (this only need be done once.
Once the field is hidden, it will stay hidden until you issue a 'show field
"next card"' command).  You should probably also tick off the "lock text"
option for that field so that users can't change it's contents even if they
manage to make the field visible (you can still change the field's contents
from a script, even if lock text is switched on).  

Getting the name of the next card is quite easy if you create the cards from
a script:  something like this excerpt should do the trick.

	...
	put the id of this card into oldcard
	doMenu "New Card"
	put the id of this card into field "next card" of card id oldcard
	-- note that "this card" changes during the doMenu "New Card" command.
	...

The excerpt should be inserted in whatever script creates new cards for your
linked list.  Multiply linked lists can be handles in a similar fashion.
If your list must link cards across stacks, then you must also store the
name of the stack as well as the id number of the card.  The command
"this stack" will return the name of the current stack.

I hope this is helpful.

	Dan Freedman.
	University of Calgary Computer Science Department.
Technical Details
Message-ID: <1088@vaxb.calgary.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!ubc-vision!alberta!calgary!freedman
References: <29942@sun.uucp>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!ubc-vision!alberta!calgary!freedman
From: freedman@calgary.UUCP (Dan Freedman)
Newsgroups: comp.sys.mac
Subject: Re: Hypercard question
Message-ID: <1088@vaxb.calgary.UUCP>
Date: Mon, 5-Oct-87 10:03:00 EDT
Article-I.D.: vaxb.1088
Posted: Mon Oct  5 10:03:00 1987
Date-Received: Sat, 10-Oct-87 18:49:04 EDT
References: <29942@sun.uucp>
Organization: U. of Calgary, Calgary, Ab.
Lines: 36