Classic Computer Magazine Archive COMPUTE! ISSUE 92 / JANUARY 1988 / PAGE 25

Computers and Society

David D. Thornburg, Associate Editor

The Power Of HyperCard, Part 1

Last month I started talking about HyperCard, Apple's new programming language being shipped with all new Macintosh computers. This product is also being made available to existing Mac owners for a very low price in the hope that everyone will soon have their own copy. Unlike traditional programming languages such as C or Forth, HyperCard can be used by neophyte programmers who, within a week of starting, can build sophisticated applications that would require a lot of effort in any other language.

I'm going to explore HyperCard for the next two months for several reasons. First, it proves that the proper design of a language can open up programming to people who would never think of themselves as programmers. Second, the underlying metaphors of HyperCard are interesting to look at in their own right.

The Problem With Macs

Just as the Macintosh is tremendously easy to use, it is also (until now) extremely hard to write programs for. HyperCard applications are both easy to use and easy to create. This combination of ease in both domains opens the world of Mac programming to hundreds of thousands of people who would not otherwise enjoy the experience of creating their own applications.

This does not mean, however, that all of HyperCard's programming environment is easy to master. It isn't. But, unlike some other "easy to master" products, HyperCard provides a seamless transition between those tasks that are easy and those that are not. This keeps the new programmer from running against a brick wall after reaching a certain proficiency level.

In some ways HyperCard is like a fourth-generation database language in that it allows the user to create custom applications as templates. Other programs of this sort that come to mind are Filevision (for the Mac) and Quickview System's excellent product, Zoomracks (for the Atari ST and MS-DOS machines). However, one must be careful when comparing HyperCard against other tools of the type mentioned. While HyperCard can be used in a template-construction mode, it is far more powerful than the other products in that it provides the user with a full-function extensible programming language from which completely new applications can be created.

Figure 1

Figure 2

More Than Macs

If HyperCard-like languages were to appear only on the Mac, they wouldn't be as interesting to explore. According to an interview with Bill Atkinson, Apple Fellow, who was the principal designer of HyperCard, the file formats will be made public so that MS-DOS versions of the product can exchange data with the Mac version. He is also working on a version for the Apple II. (His interview appears in Danny Goodman's excellent book, The Complete HyperCard Handbook, Bantam Books, $29.95.)

A Quick Look At An Application

HyperCard applications are called stacks, since the underlying metaphor is one in which the user is presented with a stack of cards that contain information: buttons that perform certain actions and fields in which data can be entered and results of calculations can be displayed. (This stack concept is similar in many ways to Paul Heckel's earlier "zoomrack" metaphor of a rack of cards.) Figure 1 shows a sample card from the "address stack."

The central figure in this image looks like a RolodexTM card containing a name-and-address field and a phone-number field. This particular card was picked from the stack by using a "find" command issued in the message box at the bottom of the screen. By clicking the mouse on the telephone-shaped button, the phone number is dialed automatically. The buttons to the left of the card image launch other applications and provide other capabilities such as sorting the stack alphabetically. The entire operation of this stack, including the creation of new entries, is based on the fundamental Macintosh model of "type and click."

At any time the user is free to build a fresh address stack using this one as a template. This new stack can have the buttons and text fields in different places, and unwanted features can be discarded and new ones added.

HyperCard is shipped with a collection of sample stacks that cover a wide range of common database activities such as maintaining calendars, phone lists, and so on. Each of these applications can be launched from a special stack called the home stack. Many HyperCard applications have a home button that, when pressed, takes you back to this stack.

Buttons can be used to perform myriad operations. Their most common use is to branch to another card or to another stack. They can even be used to launch other applications that have nothing to do with HyperCard, such as starting a word processing program. To get a feel for how easy it is to become a HyperCard author, I've created a small stack designed to let people explore the different parts of a fish. As the user clicks on different areas of a fish, the program displays the name of the area being touched and presents a brief description to the user.

Some Background Work

For our application, I started with an existing background template consisting of a frame and four buttons. These buttons came preset with the ability to go to the home stack, to advance or go back one card at a time, and to go to the first card in the stack. See Figure 2.

Figure 3

Figure 4

Figure 5

Figure 6

My application was built by pasting a clip-art picture of a fish onto the background image and by creating two text fields to contain the card title and the description of the card. This is shown in Figure 3.

The next step was to place a series of transparent buttons on the various parts of the fish that I wanted to identify. These buttons are hidden from view when in use, but are shown as rectangles in Figure 4.

At this point the stack consists of one card whose background image has a picture of a fish, two text fields, and a lot of buttons (most of which don't do anything yet.)

The next task was to label the first card by moving the cursor to the top text field and typing in its name, as shown in Figure 5.

Next, I created six more cards (each created with a single keystroke) in which I added text to identify the tail, body, gills, fins, eyes, and mouth of the fish. Once this task was complete, all that remained was to link each of my transparent buttons to the correct card in the stack. HyperCard makes this task very easy. The user simply selects the button, advances to the destination card and indicates that these two objects are to be linked. After the stack is created, the new buttons can be hidden from view so that, as soon as the user clicks on a part of the fish (its eye, for example), the appropriate card is instantly brought into view. See Figure 6.

A Look At The Watch

This application isn't very sophisticated but took only a few minutes to create. It is important to note that, except for the text associated with the parts of the fish, this program required no typing—it was constructed by direct manipulation of the programming tools. I have written extensively on direct-manipulation languages in the past, and HyperCard is (so far) the best example of this type of language I have encountered.

Next Month

Next month, we'll lift the hood and look closely at the underlying metaphor of HyperCard. We will also explore HyperCard's programming language, HyperTalk. HyperTalk is used to create the "real" programs that are hidden from view. Once HyperTalk is mastered, you are able to create fresh HyperCard applications from scratch.

Dr. Thornburg welcomes letters from readers and can be reached at P.O. Box 1317, Los Altos, CA 94023.