ANALOG Database

by: Bryan Schappel and Barry Kolbe

Publication date: October 1986

Menu driven, with English error messages, this system could make your day.

There are quite a few database systems currently available for the 8-bit Atari, ranging from fantastic packages like SynFile and LJK's DataPerfect to simple packages like HomeFind. Somewhere in the realm between these lies The ANALOG Database (ADB, for short).

ADB allows you to have from one to eight fields, up to thirty characters per field, with a maximum of 255 records. It has fully formatted printed output options and allows you to sort files in either ascending or descending order. Do I have your attention yet?

ADB is menu driven, allowing easy selection of options at the touch of a key. You're constantly informed of your data status and of any errors that may occur during operation. All errors are handled in English, for your benefit.

Please refer to your DOS manual for instructions on loading a binary file, then perform a binary load of the DB.COM file. If you wish to have ADB load and run automatically upon booting your system, simply rename the DB.COM file as AUTORUN.SYS.

Once ADB loads in, you're presented with the BBK intro screen, then, in a second or two, the ADB work screen. At this point, you're ready to use ADB.

Using it.
You'll notice, at the bottom of the screen, a line with the words FILER RECORDS PRINT. This is the main menu. There's a large cursor on the word FILER. This cursor can be moved to RECORDS or PRINT by pressing the + to move the cursor left, or * to move right. When the cursor's on the option you want, just press RETURN. Once you press RETURN, the line under the main menu displays another menu. Move the cursor around here just as you did on the main menu, making a selection by pressing RETURN, or leaving this submenu by pressing ESCape. You may only enter the submenu's RECORDS and PRINT if a file is in memory.

Now, we'll look at the submenus and all the functions available from each.

The FILER submenu.
The FILER menu consists of the following five options: LOAD, SAVE, RENAME, DELETE and NEW.

The LOAD option.
Using this command will allow you to load a previously created or edited ADB file. If a file exists in memory, ADB will ask if you wish to save it; if so, the file is saved, then the directory of ADB files will appear onscreen. Only the first thirty files will be displayed. Once this happens, you're prompted for a filename. Type the first eight characters only (ADB won't let you type more) and press RETURN. The load process will begin.

If the load was successful, you're put back into the main menu. If not, an error message will be displayed on the red ERROR line, and you're deposited back in the main menu.

The SAVE option.
This will simply save the data in memory to the disk file that you specified in the file creation process (more on this later). After a file is saved, it's erased from the computer's memory. To continue to edit your data, you must reload the file. After the save is completed, you're again returned to the main menu.

If the save was no good, an error is generated and you're sent back to the main menu. Your data is not erased if an error occurs. You may continue to edit your file.

The RENAME option.
This allows you to change the name of the data file in memory. You're prompted for a new name, then the file's renamed. Make sure you have your data disk in the drive at this time, since ADB also renames the disk file.

The DELETE option.
Selecting DELETE allows you to erase data files from your disk. You're asked for a filename to delete, then the file is removed from the disk. Once you delete a data file, it's lost foreverplease be careful. ADB does ask if you're sure before it will delete anything. After the file's been deleted, the directory is redisplayed on the screen to show its absence.

The NEW option.
This is the first option you should select when first running ADB. It allows you to set up a data file format. The creation process is fully prompted from ADB itself, so we'll only briefly cover the process.

First you're asked a filename, then the number of fields each record will have, then the names and lengths of each field. Fields names are, at most, ten characters in length. Once this process finishes, you're asked for the sort order. Respond by typing A for ascending (A,B,C...), or D for descending (Z,Y,X...). Now you're asked for the SORT FIELD. This is a very important number to enter, so do it right. The SORT FIELD is the field all your records will be sorted on - please choose carefully. After this, you're finished with the creation process. Not so bad, was it?

Please make sure your choices are made correctly, since, one entered, they're set in stone. You may not alter anything about the record structure after it's created, so plan ahead.

The RECORDS submenu.
This submenu contains all the record manipulation options. The menu reads, READ, EDIT, ADD, DELETE and SEARCH.

The READ option.
This command allows you to view onscreen the records in memory. When you enter the READ mode, you begin at record one. Table 1 shows the keys and the functions they serve during record reading.

Key Function
Move up 1 record
Move down 1 record
Jump to first record
Jump to last record
Jump to center record
Choose record
Abort READ

The EDIT option.
This option allows you to modify records entered at an earlier date. The first thing you must do is select a record to edit, by going through the READ process and pressing RETURN when the record you wish to modify is onscreen. You're then asked which field you wish to change; enter the number. Now you're asked for the new field data. Respond with a new string of characters. Once you enter your new data, ADB asks if you're certain of the new data, then inserts it into the record. You're then asked if you wish to edit the record any more. If you answer yes, the process will repeat; if not, you're allowed to select another record to edit. To exit the EDITOR, press ESC at any time.

If you alter the field your records are sorted on, the record must be deleted and then reinserted to keep the order of the file. During this process, there may be a half-second pause, so don't worry.

The ADD option.
The ADD routine allows you to enter new records into your file, assuming room exists for them. You'll be prompted to enter data for each of your fields. After this, ADB asks if the record is correct. If it is, ADB adds it to memory. If the record was in error, you're asked to enter it again from the beginning.

As you add records to your file, ADB automatically sorts them in memory. If your file is nearing the maximum number of records allowed, there may be a slight delay during the insert. After a record is inserted into memory, you may enter another.

If you say a record is not to be inserted - or you make a mistake and respond with no - the words CORRECTING RECORD are displayed on the status line, as a reminder that you're correcting a mistake. Under normal circumstances, the status line remains blank.

The DELETE option.
Selecting this allows you to delete records from memory. You choose the records you wish to delete through the READ process, pressing RETURN when the record you wish to delete is onscreen. Then ADB asks if you're certain about the delete. If you are, the record is removed from your file. If you don't wish to delete the record, ADB allows you to choose another record to delete.

The SEARCH option.
Using SEARCH lets you find all the records in memory that contain some string you wish to find. You're asked what field you wish the search to be on, then what to look for. After you enter these, ADB will display each record on the screen and ask if you want to continue searching. If you choose to continue searching, the next record containing your search criterion is displayed. When the end of your file is reached, you're returned to the main menu.

When you enter a search string, you can think of it as being bracketed by wild cards. So, if you want to search for ET, it would be found in words like: PETe, CrikET, ET the Movie and streET.

The PRINT submenu.
This is the part you've all been waiting for, the output section. ADB has two ways to print out data. They are ALL and FIELDS.

The ALL option.
Selecting ALL from the PRINT submenu allows you to print out all records in your file, as they appear on the ADB work screen. Each record is printed to the printer with one field per line, with a blank line printed between records.

Output looks like this:

     Name: Doug Green
     Street: 1224 Rose Lane
     City: San Francisco
     Zip: 01239

The FIELDS option.
This output option allows you the most freedom in printing out your data. FIELDS produces formatted columns of data, in an order you specify. When you enter FIELDS, you're asked which fields you wish to print out. Simply type the numbers of the fields you want printed and press RETURN. ADB now takes control and makes you a beautiful listing. To clarify this option, here are examples.

EXAMPLE 1: Let's say we defined a record with four fields, Name, Street, City and Zip. The fields have lengths: 20, 15, 10 and 5, respectively. If you answered 1234 to the WHAT FIELDS TO PRINT? prompt, you'd get a listing like this:

     Name                Street         City      Zip
     John Smith          123 First St.  Miami     00987
     Jane Smith          453 Lake St.   Tucson    12456

EXAMPLE 2: If you typed 213, you would get this:

     Street         Name                City
     123 First St.  John Smith          Miami
     453 Lake St.   Jane Smith          Tucson

The FIELDS option allows you a great deal of flexibility. You don't have to print each field, and you may repeat fields. However, you can only print as many columns as you have fields in each record. Meaning, if there are six fields per record, the maximum number of columns you can print is six.

There are things the PRINT functions won't do. They won't do page breaks. If you want to skip over the perforation, simply send out the proper control codes to your printer. They won't perform word wraps, either. This isn't a problem when using the ALL option, since each line is less than 42 characters. However, the FIELDS option can generate lines up to 254 characters in length. If your printer can be set for compressed print, it's recommended that you do so before using the FIELDS option.

Program notes.
Here are some tips to help you use ADB. First, to exit or abort any submenu or command, simply press ESC. You'll be returned to the main menu, to make another selection.

Pressing SYSTEM RESET will return you to DOS and destroy any data in memory.

ADB is compatible with most DOS's with a LOMEM above $2000 (i.e., DOS 2.0, SpartaDOS V2.3 and OSS A+). ADB saves your data as a standard DOS file, thus allowing you to manipulate it with your DOS.

ADB doesn't require that the BASIC cartridge be removed to run, however, having the extra 8K around is nice. If you make a file with maximum record length (240 characters) you get 97 records with the cartridge and 131 without it!

If you use a command processor DOS (SpartaDOS, DOSXL, etc.), you may reenter ADB by typing RUN 3DA5 from the command processor.

When you're asked ARE YOU SURE [Y/N]?, the Y key and RETURN indicate a positive response, and the N key plus a RETURN indicates a negative response. Only these three keys are accepted responses.

ADB thinks upper- and lowercase characters are the same. This means that the word HELLO is the same as Hello and hElLo. This was done to make record sorting more natural to the user.

Technical notes.
The intro screen was done with graphics modes 8, 2, and 1. The BBK was produced using Broderbund's Print Shop program. The letters were made using the "screen magic" program, saved to disk, then converted to a DOS file with the Print Shop File Converter (from issue 38). From there, the screen data was compacted and added into ADB.

The beautifully shaded letters on the screen were done by using the DLI created for The Clash of Kings (issue 40). Still looks good, too.

The "twinkles" or small starbursts that appear on the corners of the BBK are simply a player. The player's definition is altered every two jiffies, to produce a stunning effect. I first saw this used on Seven Cities of Gold and later on the LucasFilm games. Twinkles seem to be the current rage among intro writers.

ADB also uses a redefined character set, a custom screen and a brand new screen handler written just for this program. All this combines to make ADB an attractive, very fast database.

The project was over three years in the making, from simple BASIC versions to the final machine language product We hope you get a great deal of use from it.

Barry Kolbe is a mathematics teacher in Madison, WI. He uses the Atari to demonstrate graphing in his classroom. His former student, Bryan Schappel, is studying Computer Science at the University of Wisconsin. This is their second major project for us, as a team.

© 2008 Bryan P. Schappel • Valid XHTML Transitional • Valid CSS