Classic Computer Magazine Archive COMPUTE! ISSUE 39 / AUGUST 1983 / PAGE 140


Steve Leth

Soon after getting my PET, I realized I had a problem: cassettes. Hundreds of them. All over the place. After buying a disk drive, I thought my troubles were over. But now I have a new problem: diskettes. Hundreds of them, and, worse yet, they each hold one to two dozen programs. What I needed was a way of cataloging all these programs and the disks they're on: an inventory program, for programs. Enter HESCAT, a disk catalog program written by Jerry Bailey and distributed by Human Engineered Software.

HESCAT is available on disk for versions of PET/CBM with Upgrade ROMs or 4.0 BASIC, 40- or 80-column screens, and at least 16K of memory (32K preferred). It works with 2040, 4040, and 8050 disk drives.

How HESCAT Works

HESCAT is a series of programs accessed via a menu that appears when you run the main program. To perform a particular function, you just enter its number and the appropriate program is loaded. After each function is complete, you return to the main menu. Because every function except HELP is implemented as a separate program, HESCAT packs a lot of power into a 16K PET/CBM.

The first step in using HESCAT is to catalog your diskettes with the CATALOG function. CATALOG copies information from the directory of the disk being cataloged, which is in drive #1, and records it on the HESCAT disk, which must always be left in drive #0. After it has retrieved all the data from one disk, HESCAT asks you to insert the next disk. This continues until information from all your disks has been recorded on the HESCAT disk.

Exactly what kind of information is kept for each disk? The two-digit disk ID, the disk name, the number of free and allocated sectors, and the number of files on the disk are stored in a file called HEADERS. Then, for each diskette, HESCAT creates a file with the same name as the two-digit disk ID. This file contains a list of all the files on that disk, the type of file (Sequential, Program, Relative, or User), and the size of each file. On a 2040 or 4040 disk, you can catalog as many as 120 disks with 3300 to 6000 files; an 8050 disk will keep track of 10,000 to 20,000 files from 210 disks.

After cataloging new disks or recataloging an old disk that has been changed, the SORT NAMES function is used to create the ALPHA.NAMES file. This is a list of all your cataloged files, sorted alphabetically. It also contains the type of each file and the ID of the disk it's on. The sort routine itself is a heap-sort and is written in machine language. All the names that will fit into memory can be sorted in a second or so. Usually, however, the list of names is too long to fit in memory. In this case, HESCAT uses a scratch disk for work files that are sorted individually and then merged together. It will only sort file names from disks that have been recataloged since the last sort and will merge them into the new ALPHA.NAMES file.

Once the names have been sorted, a number of reports can be generated using the PRINT function. You can request a listing of file names, showing the file type and what disk it's on; a listing of the directories of the individual disks; or a summary of the disk header information. All of these will list on a CBM or other printer. The program also contains a subroutine for Epson and Base 2 printers.

Another practical use for HESCAT becomes apparent when you use the LOCATE function. This function searches through the file names cataloged by HESCAT for a string specified by the user and displays all the names that contain that string along with their disk ID's.

This is really a most valuable function when you forget where you stored your Space Invaders game.

Complete Documentation

HESCAT comes with two manuals totaling 37 pages. The first is the User Manual that guides you step by step through the process of cataloging disks and getting reports. The manual is clearly written and points up a number of spots where things might go wrong (especially disk I/O errors) and how to recover without losing your data. The second is the Program Manual, which covers technical information about the actual HESCAT programs. Included are detailed line-by-line narratives and variable dictionaries for each program. There is a section on how to safely modify parts of HESCAT and a complete description of all of HESCAT's file formats. In addition, the Program Manual includes complete, commented listings of all the programs, even an assembly listing of the heapsort routine. Because Jerry Bailey has used a lot of "tricks" to make HESCAT fast and compact, you can learn a lot by reading the Program Manual.

It is apparent that much thought went into making HESCAT as easy to use as possible. All user interaction with the programs is via menus, and HESCAT seems reasonably crash-proof. One of my favorite features is the HELP function in the main menu program. HELP displays a brief description of each of HESCAT's major functions. The information provided by HELP was often enough to keep me from having to refer to the manual.

To use HESCAT properly, you must update the catalog every time you start a new disk or add files to an old disk. If you don't do this, then HESCAT won't do you much good. However, if you are the sort of person who will keep the catalog updated, and you want an automated tool to help you, HESCAT is the program for you.

Human Engineered Software
71 Park Lane
Brisbane, CA 94005