A SLEEPER IN YOUR ELECTRONIC CLOSET DAVID METZLER ed. J.S. Reed You have a powerful language hiding on your system disk. The name of this language is Pilot. Put your system disk in the A drive and type: DIR PILOT.COM. If your computer says A:PILOT.COM all is well; if it says NO FILE you have to look for the file A:PILOT.COM on another disk. (When I ask you to enter something into the keyboard I will enclose what you are supposed to type in brackets {}. Do not type the brackets; they are just there to separate what you are supposed to type from the rest of the article. I will put what the computer is supposed to reply to you in all caps.) If you bought your Micro Decision some time ago, you may not even realize the potential of what you have. It has been only recently that the Micro Decision has been shipped with the documentation for the Pilot language. So if you have been missing out, read on. While you are waiting for your copy of the Pilot manual, there is an easy way to learn a lot about the language. If you put the system disk in your A: drive and do a {DIR *.PIL} command, you should see a list of files that all end with the three-letter extension, PIL. One of these files will be CPMENU.PIL. From the A> type {TYPE CPMENU.PIL}. Now you have a listing of the Pilot command files. Before we go any further, let's mention how the Pilot language works. The first thing a Pilot programmer does is to create a listing of Pilot commands like the listing of the CPMENU.PIL file you just looked at. This listing is created using any text editor, such as WordStar's non-document mode. After the listing is complete, you type in the command PILOT and then the name of the file that you created, e.g. {PILOT TEST.DOC}, and the Pilot program goes to work. The Pilot interpreter reads each line of the listing that you created and executes that instruction. You can learn a great deal about what kind of instructions the Pilot interpreter can accept just by looking at the listing of instructions in all the files with a PIL extension. Just use the TYPE command like you did to see a listing of CPMENU.PIL. Another way you can get wet with Pilot programming is to copy the following program. You may want to create this program on your system disk because it will automatically format, sysgen, and place a copy of PIP.COM on a diskette fresh from the box. All this will be done automatically. Then the bell will ring; and you can, if you wish, put in another new diskette and have it processed the same way. Be sure that you only work with a COPY of your system diskette! (If you don't have a backup of your system disk, follow the directions for BACKUP.COM in your manual.) Now that everything is all ready, put your system disk in drive B and your WordStar disk on drive A. Enter WordStar your usual way; and from the NO-FILE menu choose option N for "open a non-document file." You may not have used this option before but don't worry. The main difference is that word wrap and page breaks are off. In the non-document mode you have to hit the return key to start a new line. You are going to create source code that the Pilot interpreter is going to read. So, you want WordStar to behave itself and only use plain ASCII characters. When WordStar asks for a file name, pick an appropriate name such as {B:WORK.PIL}. Notice that the name is preceded by a B: to place this file on the B drive where your system disk is, and has a PIL extension so it can be identified as a Pilot source code file. Type in the following listing exactly as you see it. Start from the *BEGIN and end with the line END:. *BEGIN CLRS: T: THIS PROGRAM WILL AUTOMATICALLY FORMAT AND SYSGEN A BLANK T: FACTORY FRESH DISK SO THAT IT WILL BE READY TO USE. T: T: A COPY OF THE FILE TRANSFER UTILITY PIP.COM WILL ALSO T: AUTOMATICALLY BE PLACED ON THIS NEWLY PROCESSED DISK. T: AFTER ALL THIS IS DONE YOUR TERMINAL WILL BEEP. YOU THEN HAVE T: THE CHOICE OF RETURNING TO THE OPERATING SYSTEM OR PROCESSING T: ANOTHER BLANK DISK. T: T: ******************************* T: T: PLEASE BE SURE THAT THIS PROGRAM IS ON THE A DRIVE AND THAT T: THE DISK TO BE PROCESSED IS ON THE B DRIVE T: T: ******************************* T: T: *QUESTION T: ARE YOU READY (Y/N)? INMAX: 1 A: M: Y JN: *BEGIN CPM:FORMAT B D CPM:SYSGEN;A;B;;PIP;B:=A:PIP.COM;; CLRS: BELL: T: IF YOU WOULD LIKE TO PROCESS ANOTHER BLANK DISK REMOVE THE T: DISK IN DRIVE B (BE SURE TO LABEL IT SO YOU CAN IDENTIFY IT T: AS A FORMATTED SYSTEM DISK) AND PLACE ANOTHER BLANK DISK IN T: DRIVE B. T: J:*QUESTION END: To use this program take out your WordStar disk and place your system disk in drive A (this disk was in drive B). Take a fresh unused blank disk and place it on drive B. At the A>, type in the command {PILOT WORK}. The rest will be self explanatory. If the program doesn't seem to work properly, read the rest of this explanation to learn how the program works. It will then be easier to find the typing error. There are 31 commands available to the Pilot programmer. This example (WORK.PIL) accomplishes a great deal using only 8 of the most often used of these commands. Let's take a look at each of these commands we jsut used to learn how Pilot ticks. First, the normal syntax is COMMAND:WHAT THE COMMAND WORKS ON The COMMAND before the colon is one of those 31 commands that the Pilot interpreter understands. The WHAT THE COMMAND WORKS ON after the colon is usually characters that you chose depending on your application. For example, the line: T: This is easy. tells the Pilot interpreter to print or Type the line "This is easy." on your terminal screen. Now let's take a look at a series of three interrelated commands taken from the WORK.PIL source code. A: M: Y JN: *BEGIN The command A: tells the interpreter to stop and wait for the operator to type something on the keyboard and accept it for future use. The command JN:*BEGIN tells the interpreter to jump to the line that starts *BEGIN on a no or negative condition. In English, that means that the interpreter looks at what the operator typed in response to the A: (accept) command, and matches it to the characters that follow the M: (match) command. If the two series of characters do not match perfectly, you have a negative condition and the jump takes place. If a perfect match is made, you have a yes or positive condition so the jump command does not get executed. The interpreter just skips to the next line in the source code. If you would like the jump to take place on a yes condition instead of a negative condition, the source code would read: JY:*BEGIN. Notice that the syntax is changed a little now. The new syntax is: {COMMAND} {CONDITION} (either Y or N) :WHAT THE COMMAND WORKS ON Most Pilot commands can be modified with a Y or N conditional. Of course, the J: (jump command) can be used without a conditional. For example, J:START would instruct the interpreter to jump to the line that starts *START regardless of what happened previously in the program. The CLRS: command is easy; it clears the screen. The BELL: command rings the bell. The CPM: command allows direct access to CP/M command files. For example, CPM:DIR would give a directory of the logged in drive, just as it would if you had given the command yourself. Be sure not to leave any spaces after the colon. For example, CPM:FORMAT B D would work, but CPM: FORMAT B D would not work. Notice that you pass the information about the B drive and double-sided format to the FORMAT command by just using the spaces. Usually, though, you separate the command from the arguments (instructions) with semicolons. For example: CPM:PIP;A:=B:FILE1;A:=B:FILE2 The INMAX:1 command tells the interpreter that the operator is allowed to enter only up to the number of characters specified after the colon. After that number of characters are entered the Pilot interpreter will continue doing what it is supposed to do just as if the operator had hit the return key. DAVID METZLER C/O CMDUG 226 BOSTON POST ROAD ORANGE, CT 06477