CARDSTAK,
START'S FREE-FORM DATABASE
by ALEX LEAVENS
A new breed of database manager is appearing on the computer market. These new systems are every bit as powerful as traditional file managers, but they're much more intuitive because they use a familiar concept- organizing information on stacks of index cards. Now START brings you CardSTak-our own Hypercard-style program. You'll it find on this issue's START disk!
You'll find the program for this article, CARDSTAK.PRG, on your START disk. The source code is in the compressed file CARDSTAK.ARC.
People have been using filing systems a lot longer than computers. Back in the B.C. era-Before Computers- the ubiquitous 3-by-5 index card stored everything from recipes to library information to business inventories, and people got along just fine.
Computers changed all that. With powerful machines and mass storage, filing systems became "databases," and arcane terms like "relational," "file manager," "field" and "record" became buzzwords. Eventually the systems became powerful and highly advanced -but almost too complicated to use.
Fortunately, we've started to come frill circle. The Winter 1987 START profiled Paul Heckel, who pioneered the idea of mimicking index cards on a computer with Zoomracks II. Last year Apple Computer made headlines with Hypercard, bringing the same idea to the Macintosh.
And now START brings you CardSTak, a free-form database program that matches the power of your ST with the simplicity of a 3-by-5 card.
CardSTak
Before you run CardSTak, copy the files CARDSTAK.PRG and CARDSTAK.RSC
from your START disk to a blank formatted disk, so you will have plenty
of room to store your data files. To run the program, double-click on CARDSTAK.PRG.
After a few seconds your screen will display a menu bar at the top and
a GEM-style window in the top left-hand corner. This window is where you'll
type the first card in your database.
CardSTak is a free-form database You don't have to worry about fields or delimiters -simply start typing information into a card. Use the arrow keys to move around inside the card, and use the Delete and Backspace keys to erase mistakes. There is no insert mode. To move through the cards one card at a time, click on the arrows at the bottom of the window; to go forward or backward 10 cards at a time, click on the shaded areas. You can also move using the slider bar, or move through the cards a card at a time by holding down the Shift key while pressing the right or left arrow key.
A line at the top of each card tells you the current card number; you can have a maximum of 500 cards. This status line also tells you whether the card is marked, and the name of the current file (if it's a new file the line says Empty).
Once you have entered all the cards for a database, save it to disk by clicking on Save under the File menu. Give the database a name, but be sure to add the extender .CRD (for example, RECIPE.CRD or ROLODEX.CRD). If you want to start on a new database after you've saved the current one, or simply want to get rid of what you've typed in and start over, click on Clear under the File menu. To load a previously-saved file into memory, click on Load under the File menu.
To make using CardSTak easier, most of the menu commands have control-key equivalents, which are indicated on the drop-down menus. For example, to quit you can either click on Quit under the File menu or hold down the Control key and press Q. In addition, many commands also have function key equivalents. For a list of these, click on Show Function Keys under the Options menu.
Mark Your Place
CardSTak allows you to "mark" specific cards, the way you might use
paperclips or Post-It notes to mark real index cards. For example, if you
have a recipe database you might want to put all the desserts, appetizers
and so on into separate groups.
CardSTak has six different marks you can use. To select which mark is currently active, click on Select Mark under the Options menu and then click on a mark number. To mark the card you're looking at, select Mark under the Edit menu. To remove a mark, select Un-mark under the Edit menu. Unmark All will remove all instances of the current mark. A card can have more than one mark, so it can be grouped in more than one category.
Once you have marked all the cards that you want grouped together, click on Get Mark under the Edit menu. Now when you move through the cards, you will only see cards set with the current mark. Click on Get Mark again to continue working with all the cards.
You can also create a new file that contains only the cards set with the current mark (for example, a file called DESSERTS.CRD). Click on Save Marked under the File menu, and CardSTak will create a new file which contains only the cards set with the current mark. The new file will preserve the numbering of the marked cards; if your dessert recipes were on cards 3, 6 and 12, only those cards in the new file will contain information- the rest will be blank. To get rid of these blank cards, click on Compress under the Edit menu.
If you want to combine a file on disk with the current file in memory click on Merge under the File menu. Note that this option will retain the same card numbers of the file on disk, so some cards may be overwritten. Select Merge At to merge the cards beginning at the current card number; if you use this option CardSTak will warn you before writing over any cards that aren't blank.
Rearranging Cards
To put a copy of a card somewhere else in the stack, click on Cut under
the Edit menu. Move to the position where you want to copy the card and
click on Paste under the Cut menu. Note that the card is now in two places
in the stack. To delete the original card, click on Delete under the Edit
menu. (This simply empties the contents of the current card.) To get rid
of the empty card completely, click on Compress under the Edit menu.
CardSTak can sort cards or search through them with the options Rearrange and Search, respectively, under the Edit menu. Before using these options, however, you will need to set up the criteria for the sort or search. For example, under the Options menu you can select Sort A - -> Z or Sort Z - -> A to set the sort direction. You also need to tell CardSTak which information on the card needs to be searched or rearranged.
Even though CardSTak doesn't have fields, it's smart enough to tell where words begin and end, and to treat words that are in pretty much the same position on each card as related. To tell the computer which word on the line on which to sort, first put the cursor anywhere on that word in any card. Next, tell CardSTak whether to count to that word from the left side of the card or the right. To sort on the first word in a line, put the cursor on that word and then click on Look Right under the Options menu. To sort on the second-to-last word in a line, put the cursor on that word and click on Look Left.
For example, if the first line of each card contains the name of a person, the last word on that line will generally be the person's last name. Put the cursor on that word and click on Look Left, and you can sort by last names even if some cards have middle names on the same line.
If you know exactly where on the card the search or sort criterion begins, put the cursor on the appropriate line and column position and click on Look Absolute under the Options menu. CardSTak will begin the search or sort at that word.
Search Me
CardSTak offers two ways to search through cards. For either approach,
position the cursor on the word on the card you want affected by the search
and click on either Look Left, Look Right or Look Absolute-just as for
sorting. If you want to quickly mark all cards which match a particular
word, click on Fast Search under the Edit menu. In the dialog box, type
in the word you wish to search for and press the Return key. All cards
with a word in the cursor position that match the word you entered will
be set with the current mark.
If you want to narrow down the search, after positioning the cursor click on Search under the Edit menu. Since you'll be marking cards with the current mark, you have the option to unmark all cards currently set with that mark. Next, since this is a custom dialog box, click on the edit line and type the word you wish to search for and press Return. Click on Ok or Abort; if you change your mind and want to edit the word again, click on the edit line again and start over.
When you click on Ok, CardSTak will offer three options. You can mark all cards that match the word you typed ("equal"); you can mark cards with a word earlier in the alphabet ("less than"); or you can mark cards with words later in the alphabet ("greater than"). You can select more than one of these; you may wish to mark all cards that are equal to or are greater than the word you typed. When you're finished making your selection, click on Done, and CardSTak will mark all the cards that match your criteria.
Put It On Real Index Cards
Finally, CardSTak can print out your cards for you, either with or
without the top status line. To print the cards that are set with the current
mark, click on Print under the Options menu; to print all the cards regardless
of their setting, click on Print All.
If you want to print out only certain lines in the cards, click on Print Using under the Options menu. Next, click on the line where you want to start printing, then click on the last line to print. Finally, click on Print or Print All as before.
If It Ain't Broke.
Rather than creating a new approach to organizing information, I've
brought the power of the Atari ST to an idea that's been around awhile-and
made it that much better. Don't be deceived by CardSTak's seeming simplicity.
Although it's easy to pick up and use, beneath its mild-mannered exterior
beats the heart of a very powerful filing system. I hope you enjoy it!
If you'd like more articles like this, circle 200 on the Reader Service card.
Alex Leavens; author of the START Icon Editor (Spring 1987) and STARTCaIc (Fall 1987) is an avid GEM programmer. Alex wrote CardStak for the same reason he writes most of his programs: he couldn't find a commercial software product to do what he wanted.
Products Mentioned
-
Zoomracks II, $149.95. Quickview Systems, 146 Main St., Suite 404, Los
Altos, CA 94022, (415) 965-0327.
CIRCLE 189 ON READER SERVICE CARD