Archive Series – Part 3: First Commands or Close Encounters of the First Kind

Author(s): Bill Cable
Publication: Update Magazine
Pub Details: Update January 1991
Date: January 1991
Pages: 23-25

ARCHIVE SERIES PART 3 : First Commands or Close Encounters of the First Kind

In this column we will finally load ARCHIVE and use it. We will start out slowly using the most basic commands needed for database work : QUIT, LOOK, OPEN, CLOSE, DISPLAY, FIRST, LAST, NEXT, BACK. Extremely elementary so anyone can follow along. There will be no programming done. We will issue our commands directly to the ARCHIVE prompt utilizing its user friendly mode. Those who shun anything to do with programming have no excuse for not following along.

First I would like to pass on some interesting information about ARCHIVE. I have been converting my QL ARCHIVE programs to work on PCs. I have had pretty good success which is impressive considering how different the QL and PC are. PC ARCHIVE is significantly faster but my large programs have a tendency to have random pauses of several seconds now and again (memory management problems of some sort). Trying to get more information on this problem I called Rowan Prior of PSION USA in Watertown, CT. PSION created ARCHIVE and supplies it packaged as PC-FOUR with QUILL, ABACUS, and EASEL. ARCHIVE has not been revised in years and is essentially supplied as is with no vendor support. Rowan advised me to contact Colin Hughs of TRANSFORM Ltd, 7C Station Approach, Hayes, Kent, England, BR2 7EQ, Tel: 014481 462 4666. I did and Colin advised me to break my programs into 12k blocks. Something I don’t have to do on the QL. He also told me that TRANSFORM has a new version of PC ARCHIVE which should be available in January. It is called ARCHIVE+ and has many new enhancements plus will be much faster. It will run under DOS or UNIX and will sell for about 250 pounds. I can be licensed to provide ARCHIVE+ with my software for 50 pounds a copy. This is all very good news for me since I use ARCHIVE as my primary programming language. Now it seems, my programming language will be up-to-date and well supported. I was considering shopping for another database language for my PC work but now I won’t have to. Apparently the British military is a heavy user of ARCHIVE and that provided enough incentive for the development work. An excellent database system has risen from the software graveyard. Watch out DBASE, FOXBASE, PARADOX, CLARION, HYPERCARD. I will provide more information about ARCHIVE+ when I get a copy. This only indirectly helps the QL. But I have found the QL ARCHIVE adequate for my QL needs. At least QL users who take the time to learn ARCHIVE will be able to apply the knowledge gained to other computers.

PREPARATIONS FOR USING ARCHIVE

Now let us begin working with ARCHIVE. Make a working copy of your original database cartridge if you haven’t already. It is important to always have multiple backups of important files. IF YOU EVER HAVE A FILE THAT BECOMES CORRUPTED NEVER START USING YOUR BEST BACKUP DIRECTLY. MAKE A COPY OF IT AND WORK WITH THE COPY. This is a universal principle no matter what computer you use. Open your QL manual to the ARCHIVE section. Become as familiar with it as you can. It is the best reference available. Pages 41-52 covering command and function definitions are most important. Read them over and over as you play with ARCHIVE. At first you won’t understand much but each time you will pick up a little more. When you have error messages look them up on pages 52-54.

STARTING ARCHIVE

I will refer to microdrives (mdv) in my descriptions below but substitute floppies (flp) or RAM (ram) as you like. If you are confused about configuring ARCHIVE to work with floppies or RAM send a SASE for help. Reset your QL put your ARCHIVE database cartridge in mdv1_ and press <F1>. Archive will boot up and you will see boxes at the top, an open middle area, a thick line near the bottom and a “>” below with the cursor. This is ARCHIVE’s most user friendly mode. It is a good configuration for beginners. Later we will use more efficient modes as ARCHIVE is quite adaptable. ARCHIVE will execute each command directly when you type them on the command line where the cursor is. The boxes at the top provide helpful information about what to do and what is happening. Note that pressing <F1> will activate the HELP system. With it you can query about the various commands and functions of ARCHIVE whenever you want. It is fun to play with the various levels of help and learn at the same time. Pressing <F2> makes the top boxes go away or reappear. This allows you to free up more screen. Pressing <F3> cycles through 4 listings of all ARCHIVE commands in the top center box. A quick way to recall a command. The commands are not activated unless you type them out in full in the lower part of the screen and press <ENTER>. The command does not have to be currently listed in the box to be issued. Press <F3> 4 times and read all the commands. Notice that they all are familiar words and their actual function within ARCHIVE is closely connected with their standard English meanings. Many commands take arguments (more information). Often the arguments need to be in quotes (“”). If you type the command and then <ENTER>, ARCHIVE will put in the quotes for you and tell you what additional information is needed and you can type it in and press <ENTER>. It doesn’t matter if you type commands in lower or upper case. ARCHIVE allows you to type ahead. You can issue a new command before the first one has finished. Pressing <F5> will recall your last command line. You can press <ENTER> to reissue it or use the arrow keys to edit it. This feature saves lots of typing. ARCHIVE has a complete enough set of commands that it can be considered a self contained operating system of its own. In many ways it is a much friendlier environment than SUPERBASIC and QDOS because you have help at the top of the screen and a help file available by pressing <F1> and a friendlier error trapping system. It is essentially an operating system designed to handle databases (file cards). It turns out that many of our computer applications fit easily into this database structure so ARCHIVE is a natural environment to work in.

FIRST ARCHIVE COMMANDS

<ESC> Command

This is not really a command but it is a way to interrupt ARCHIVE or abort a command to get the ARCHIVE prompt again. Use it whenever you get confused by what is happening or want to cancel a command. Sometimes it works better by hitting several <ESC> quickly. It is equivalent to <CTRL-SPACE BAR> in SUPERBASIC. Some commands don’t interrupt in the middle and you have to wait until they are completed.

QUIT COMMAND

It is very important to QUIT when done with ARCHIVE. QUIT closes all open files and returns you to SUPERBASIC. ARCHIVE supports access to many databases simultaneously and you should always close them when done. By using QUIT at the very end you make sure all files are closed. Turning off your QL with OPEN data files is a no-no with ARCHIVE as mentioned in earlier columns. Even if you get totally confused while working with ARCHIVE and no cursor can be seen. Press <ESC> many time and type QUIT<ENTER>. Wait a reasonable time for the <ESC> to have effect and the QUIT to be executed. After you QUIT you will see a blank screen with the cursor at the bottom. You are back in SUPERBASIC. Since windows have been closed it is best to reset you QL before continuing. If you are multitasking then always make sure you QUIT any ARCHIVE jobs before turning off your computer.

LOOK and OPEN COMMANDS

ARCHIVE deals with data and the data is stored in special files on microdrives called databases. These are like stacks of file cards. To access previously stored data we must use the LOOK or OPEN commands. The LOOK command provides a safe way to access a database. If you only want to inspect data but not alter or add to it then use LOOK. If you want to make changes to your database then you have to access it with the OPEN command. Both commands need to be followed by information which identifies the device & file to be accessed. Later when we work with multiple files we will also need to assign a logical name when we OPEN or LOOK so we can keep track of which database is which. For now we will just work with just one database and ARCHIVE assigns a logical name of “main”. One technique that minimizes database vulnerability is to always use LOOK and then switch to OPEN temporarily when changes are made. For now we will only use LOOK and explore OPEN next issue.

CLOSE COMMAND

After you are through working with a database you should always CLOSE it even if you stay in ARCHIVE to do other work. This insures that everything is properly tidied up. If you have accessed the database with the OPEN command it is extremely important to type CLOSE<ENTER> when done. If you fail to to that and also fail to QUIT ARCHIVE your database could be corrupted and you will not be able to access the data again.

DISPLAY COMMAND

This is an easy way to see one record of data in a database after you have used LOOK or OPEN to access it. Once a database has been accessed you are always positioned in it at a specific record (card). DISPLAY lists the fields and values of the current record. It is like displaying one card of your stack of file cards.

NEXT, BACK, FIRST, LAST COMMANDS

These are simple commands to move around the records of a database. They allow you to change your current record position in your database. Since your database is like a stack of file cards you can think of these commands as moving to a different card. They do exactly as they say. If you have used the display command you will see your current record. If you type NEXT<ENTER> you will move to the next record and see it (which becomes your current record). If you are at the last record and type NEXT<ENTER> nothing will happen because there is no next record. Remember when you use these commands you have to type the whole command and then enter. But after you have typed it once you can type <F5><ENTER> to repeat the command. It doesn’t matter if you are displaying records or not. These commands still move your current record position whether visible or not.

USING THE COMMANDS

Below I will list exact key presses with comments in (). We will LOOK at the GAZET_DBF provided on your database cartridge. It consists of the information about the countries of the world. Each record consists of the values for a particular country for the fields of the database. You have loaded ARCHIVE as described above.

look "mdv1_gazet_dbf"<ENTER>
display<ENTER>
last<ENTER>
first<ENTER>
next<ENTER>
<F5><ENTER>
<F5><ENTER>
(do many times)
last<ENTER>
back<ENTER>
<F5><ENTER>
<F5><ENTER>
(do many times)
close<ENTER>
quit<ENTER>

The above exercise is indeed very simple without more commands we wouldn’t find much use for ARCHIVE. Try experimenting with other commands on your own. Next issue we will cover more commands in detail.


ARCHIVE BASED SOFTWARE
FOR THE QL
Wood and Wind Computing
RR3 Box 92
Cornish, NH 03745