Classic Computer Magazine Archive COMPUTE! ISSUE 36 / MAY 1983 / PAGE 234

TCON: The Apple Writer Processes Programs

Michael Ginsberg

Would you like to have the power to: change all or some variables in an Apple program; look at two different parts of a program at the same time; find all occurrences of a word or phrase; move one or more lines of a program around at will; have named GOSUB targets; and have other powerful programming tools at your fingertips? You've already got it. Here's how to get more out of the Apple Writer than you may have thought possible.

The Apple Writer, the word processor which comes with every Apple II, can be used in two ways to aid your programming. First, you can use the features of Apple Writer to modify existing programs. Second, you can write your new programs directly using the Apple Writer. If you write programs using the Apple Writer, the only difference is that you use the control-K to keep the characters in uppercase.

A knowledge of text files and BASIC files is necessary to understand how this process works. A short program is included here for files that are currently BASIC programs. This short program uses the EXEC feature of the Apple to create a routine that converts the BASIC program to text so that the Apple Writer can read it.

The TCON program appends three lines to the beginning of your program. The line numbers are 0, 1, and 2. If you already have lines in your program that use those numbers, you must increase these line numbers to 3 or above. First, type in and run EXEC TCON; it will create the TCON program which will convert BASIC to text. Load in the BASIC program and type in EXEC TCON; the disk will start spinning, and your program will be converted. When the program has been converted, you can boot your Apple Writer and use all of the features to help you debug your program. After it is booted, you should hit control-K so it will be in alpha lock.

Some of the features of TCON are: search, replace, scrolling, deleting and retrieving, split screen, and word and phrase counter. Some experimenting with Apple Writer is necessary to learn how it works. After you have finished debugging your program, all you need to do is save the file.

The next step involves converting your file to a BASIC program. This sounds hard but is actually quite simple. After DOS is booted, you need to type NEW; then type EXEC followed by the file name. That's it. Two minutes later, after you've seen many ]'s, your file will be magically converted to a working BASIC program. Now you should save the BASIC program and, if you are through making changes, you can delete the text file. Apple Writer can be extraordinarily versatile as a programming aid.

10 Q$ =  CHR$ (34) : D$ =  CHR$ (4)
20  PRINT D$; "OPEN TCON"
30  PRINT D$; "WRITE TCON"
100 PRINT "0  D$ = CHR$(4) : PRINT D$; "Q$;"
       OPEN FILE"Q$; CHR$ (13)
110 PRINT "1  PRINT D$;"Q$; "WRITE FILE"Q$;":
       LIST 3-"; CHR$ (13)
12O PRINT "2  PRINT D$; "Q$;" CLOSE FILE ";Q$;"
       : END" CHR$ (13)
130 PRINT "RUN"
140 PRINT "0"; CHR$ (13): PRINT "I"; CHR$ (
       13): PRINT "2"; CHR$ (13)