This wizard is on vacation this month, but in a remarkable bit of good timing, our newest member has submitted a stack of her very own. Although lacking a certain whimsy usual to this column, Drury's Formulary is a superb first effort. I thought it would do you all good to see an actual stack created by an actual non-programmer.
WHAT IT DOES
I quote from Drury's voice card: "This is a listing of drugs for use in our exotic animals (a formulary). Some drugs have actually been tested in certain species. Some drug doses are taken from best guesses. I would like to be able to list the drug's generic name, brand names, formulations (tablets, liquid, injectables etc.), mode of action, dosages in the different species (about seven groups) with some indication about how the dose was obtained, contraindications, and references. I made a hypercard stack with my first attempt. Would you look at it and make suggestions? Eventually I would like to publish this information in a small book form for veterinarians."
Drury's stack is simple, but quite functional. She has created 11 fields of information, and put all of these fields in the card's BACKGROUND so that every card automatically shares the same fields. She has used the text tool to place bold face labels in front of each field (again in the background so that the labels appear on every card). Since the actual information appears in plain (not bold) Geneva, it is easy to distinguish the labels from the data.
Drury also included three background buttons: a next arrow, a previous arrow, and a sort button. The sort button was apparently pasted from the address stack that comes with HyperCard. Yes! It is possible to cut and paste buttons just as you can pictures! These buttons provide the ability to sort and scan back and forth through the formulary cards, and all of this without having to do ANY actual programming!
There is always room for improvement, even in the niftiest stacks. It would be nice to have a table of contents at the front of the stack so that you could scroll down to the desired drug and just click on it to zip directly to that particular card. This becomes especially desirable as the number of cards increase. Many of the stacks in Archipelago are designed like this, including the voice cards and the book reviews.
You will probably want the contents card to be a different background than the rest of the stack so that none of the fields or buttons or labels clutter up the Table of Contents. To create a card of a new background, simply choose "New Background" from the Objects menu. Unfortunately, this creates the new card AFTER the current card, so getting it to the front of the stack is a bit tricky.
Here's what you do: move to the first card in the stack and choose "New Background." A blank card will appear. Now travel back one card to the first card in the stack by hitting the left arrow on your keyboard. Choose "Cut Card" under the Edit menu. The card will disappear and you will again be staring at the blank Table of Contents card. Now choose
"Paste Card" from the Edit menu. The card you cut will now be pasted in AFTER the Contents Card and everything is now both hunky and dorey.
Now that you have a blank card at the front of your stack, how do you create a clickable index? Since I have already created such a beast, there is no need to reinvent the wheel. Simply go to the Contents page of the Book Reviews stack and steal mine. That is, choose the field tool, select the index field, choose Copy Field, return to your blank contents card, and PASTE! You may want to resize the field so that it can accommodate the longer drug names.
There is a trick to using index fields. When you click on an index field, a short script INSIDE the field itself figures out which line you clicked on and then jumps to a card OF THE SAME NAME. So in order to use an index, you have to name each card with the name of the drug it describes, exactly as it appears in the table of contents. (Actually, the Book Review script automatically appends "BK" in front of the title so as to distinguish book reviews from other types of cards in a transit stack during the Harvesting process. This is not necessary for our purposes, so you may remove this line from the index field script.)
So far so good. The only problem now is: how do you get titles to appear in the index? and how do you name each card? The solution is a new feature which would have been my next suggestion anyway: a NEW CARD button. Whenever the user pushes the NEW CARD button, the button asks for the name of the new drug and then 1) Adds the title to the index field, 2) Creates a brand new formulary card, 3) Types the new drug into the title field, and 4) Names the card with the title. Incidentally, you should keep the title to less than 30 characters.
If you like, you can save even more time by stealing the NEW REVIEW button from the Book Review stack. You will need to make a few minor alterations in the script (e.g. remove the "BK" and the "*" appended to new titles, and don't bother copying and pasting a special template card; just go to the last card in the stack and domenu "New Card").
It would be nice if the sort button would also sort the index field. This is a bit tricky (but you can again steal my sort button in the Book Review stack). Or better yet, eliminate the need for sorting altogether by automatically placing the card and title in alphabetical order WHEN IT IS CREATED! If you want to do this, ask me and I will provide a script in a future Mr. Wizard.
Another nice feature would be a background field which automatically displays the card number, e.g.
"This is card 157 of 560". To keep this field always up to date for every card, place a simple "On OpenCard" handler in the BACKGROUND script of the formulary cards. The following handler should do nicely:
put the number of cards
put the number of cards
of this background
put the number of this card
put "Card "&(z-x+y)&" of "&y
into field "Card Count"
This script will work even if a table of contents card of a different background appears at the front of the stack. Be sure to name your new background field "Card Count".
A FINAL THOUGHT
Drury mentioned that she would eventually like to publish this formulary in book form for other veterinarians. If you spiff up the screen design of the formulary cards, it may actually be possible to send the cards directly to a laserprinter or typesetter in a form that the printer can use as galleys to print the book! This could save an enormous amount of time and money. To accomplish this, you may want to turn the information sideways before printing. This is rather tricky, but it can be done. Drury, let me know if you want to do this!
Thanks again to Drury for submitting this wonderful little stack. Next month I hope to return with another stack of no apparent redeeming value.