A CHECKSUM PROGRAM FOR THE ST
BY CLAYTON WALNUM
Typing in a BASIC program listing can be a frustrating and time-consuming task. Just one mistyped character will frequently render a program completely unusable. So to ensure that your program will run correctly, the entire listing must be checked character by character against the original. This can take many hours. To make matters worse, you can't trust your own eyes. Do you know how easy it is to overlook an O where a 0 is supposed to be?
Typing checkers like ST-Check take over the arduous task of proofreading your program files. Using this program can cut down your debugging time by a huge factor. When the checker's output matches that published with the listing, you can be sure your typing is accurate.
When you run ST-Check against itself, you will get one of several results. The program may just give up and crash. In that case, go through the listing character by character until you find your typing error.
A second possibility is that the program will run okay, but will create all bad checksum data. This may indicate an error somewhere between Lines 80 and 420. Find the typo and correct it.
The last possibility is that the checksum data will have only a few bad values. In this case, use the normal method detailed below to locate your errors.
Warning: Until you get your checksum data for ST-Check to match the data following the listing, you can't trust it to proofread other programs.
When you finish typing a ST BASIC program listing from the magazine, save a copy to your disk, and then run ST-Check. The program will first ask for a filename. Type in the name for the program you wish checked (the one you just saved to the disk), and press RETURN. You'll then be asked for a "bug" name. Enter a filename for the checksum file (this can be any name not already on the disk), followed by RETURN.
ST-Check will now proofread the program. When the checking process is complete, you'll have a file on your disk (saved under your bug name) which contains the checksum data for the program checked.
Check the last value of each line. If it matches the value in the published checksum data, go on to the next. If it doesn't match, you've got a typo.
To find the error, look at the line number of the data statement in which the bad value occurred. This number is equivalent to the first program line the data evaluates. Let's call this "Line X." Count the entries in the data line until you get to the bad value. We'll call this count "Y." Now look at the program you typed in. Starting with and including Line X, count down Y lines. The line you end up on will be the one containing the typo.
Correct the error, and then rerun ST-Check. When you get all the checksum data to match that published in the magazine, your new program is ready to run.
Passing the buck
Okay, friends. Here's where the truth comes to the fore. I can take only minimal credit for ST-Check, as it's virtually a direct translation from D:CHECK2 (ANALOG #16) by Istvan Mohos and Tom Hudson. All accolades and tribute should be directed to those two fine gentlemen. I'm sure they'll divvy it up fairly, and perhaps pass a small share onto me. Thanks, guys!
You may now type in this month's ST BASIC program, secure in the knowledge that the searching eye of ST-Check is primed and ready.