by Clayton Walnum
BASIC Editor II is a utility to help you enter BASIC program listings published in ANALOG Computing. To simplify the identification of errors, each program line is evaluated immediately after it's typed, eliminating the need for cumbersome checksum listings. When you've finished entering a program using BASIC Editor II, you can be certain it contains no typos.
An option is provided for those who wish to use standard BASIC abbreviations. Also, the program retains all Atari editing features. Finally, for those who prefer to type programs the conventional way, using the built-in editor, a post-processing mode is available. It allows you to check typing after the entire listing has been entered.
Typing
in the Editor
To create your copy of BASIC Editor II, follow the instructions below-
exactly.Disk version
(1) Type in Listing 1, then verify your work with Unicheck (see Issue 39).
(2) Save the program to disk with the command SAVE "D:EDITORL1.BAS".
(3) Clear the computer's memory with the command NEW.
(4) Type in Listing 2, then verify your work with Unicheck.
(5) Run the program (after saving a backup copy) and follow all the on-screen prompts. A data file will be written to your disk.
(6) Load Listing 1 with the command LOAD "EDITORL1.BAS".
(7) Merge the file created by Listing 2 with the command ENTER "D:ML.DAT".
(8) Save the resultant program with the command LIST "D.EDITORII.LST".
Cassette version
(1) Type in Listing 1 and verify your work with Unicheck.
(2) Save the program to cassette with the command CSAVE. (Do not rewind the cassette.)
(3) Clear the computer's memory with the command NEW.
(4) Type in Listing 2 and verify your work with Unicheck.
(5) Run the program and follow the onscreen prompts. A data file will be written to your cassette.
(6) Rewind the cassette.
If
the program you're
entering is particularly
long, you may need to
take a break,
entering is particularly
long, you may need to
take a break,
(7) Load Listing 1 with the command CLOAD.
(8) Merge the file created by Listing 2 with the command ENTER "C:".
(9) On a new cassette, save the resultant program with the command LIST "C:".
Using
the Editor
Take a look at one of the BASIC program listings in
this issue. Notice that each program line is preceded by a two-letter
code. This code is the checksum for that line; it's not a part of the
program.To enter a program listing from the magazine, load BASIC Editor II with the ENTER command, and run it. You'll be asked if you wish to allow abbreviations (see your BASIC manual). If you do, type Y and press RETURN. Otherwise, type N.
Note: If you set BASIC Editor II to allow abbreviations, the program will run slightly slower.
Your screen will now be divided into two "windows." The upper window will display each line after it's processed, as well as the checksum generated for that line. The lower window is where program lines are typed and edited.
When the program's waiting for input, the cursor will appear at the left margin of the typing window. Type a program line and press RETURN. The line will be evaluated and reprinted in the message window, along with the checksum generated.
If the checksum matches the one in the magazine then go on to the next program line. Otherwise, enter the command E (edit) and press RETURN. The line you just typed will appear in the typing window, where you may edit it. When you think the line has been corrected, press RETURN, and it'll be reevaluated.
Note: You may call up any line previously typed, with the command E followed by the number of the line you wish to edit. For example, E230 will print Line 230 in the typing window. Do not attempt to edit any program lines numbered 32600 and higher. These lines fall within the BASIC Editor II program.
If you're using BASIC abbreviations, the two versions of the command E work slightly differently. The command E, without a line number, will call up the line exactly as you typed it. When you append the line number, the line will be printed in its expanded (unabbreviated) form.
Leaving
the Editor
You may leave BASIC Editor II at any time, by
entering either B (BASIC) or Q (quit). If you type B, the Editor
will return you to BASIC. Enter LIST
to review your work, if you wish. Note that lines 32600 and
above are the Editor program. Your work will appear before these lines.
To return to the Editor, type GOTO
32600.Type Q and you'll be asked if you really want to quit. If you type Y, the Editor program will be erased from memory, and you may then save your work in any manner you like. If you type N, the Q command will be aborted.
Large
listings
If the program you're entering is particularly long,
you may need to take a break. When you want to stop, type Q and press RETURN, then save your work to disk
or cassette. When you're ready to start again, load the program you
were working on, then load BASIC Editor II with the ENTER command. Type GOTO 32600, and you're back in
business.The
post-processor
Many people may not want to use BASIC Editor II when
entering a program listing, preferring, instead, the Atari's built-in
editor. For that reason, BASIC Editor II will allow you to check and
edit your programs after they've been typed.To take advantage of this option, type any magazine program in the conventional manner, then save a copy to disk or cassette (just in case). With your typed-in program still in memory, load BASIC Editor II with the ENTER command, then type GOTO 32600.
Respond with N to the "abbreviations" prompt. When the Editor appears on your screen, enter the command P (post-process), and the first program line will appear in the typing window. Press RETURN to enter it into the Editor.
The line will be processed, and the checksum, along with the program line, will be printed in the upper window. If the checksum matches the one in the magazine, press RETURN twice, and the next line will be processed.
If you find you must edit a line, enter the command E, and the line will be moved back to the typing window for editing.
When the entire listing has been checked, you'll be asked if you wish to quit. Type Y and press RETURN. The Editor program will be removed from memory, and you may then save the edited program in any manner you wish.
Murphy's
Law
Anyone who's been associated with computing knows
this is the industry Murphy had in mind. You may find that, after
typing a program with BASIC Editor II, it still won't run properly.
There are two likely causes for this.First, it may be that you're not following the program's instructions properly. Always read the article accompanying a program before attempting to run it. Failure to do so may present you with upsetting results.
Finally, though you can trust BASIC Editor II to catch your typos, it can't tell you if you've skipped some lines entirely. If your program won't run, make sure you've typed all of it. Missing program lines are guaranteed trouble.
One last word: Some people find it an unnecessary and nasty chore to type REM lines. I don't condone the omission of these lines, since they may be referenced within the program (a bad practice, but not unheard of). If you want to take chances, BASIC Editor II is willing to comply.