Classic Computer Magazine Archive COMPUTE! ISSUE 21 / FEBRUARY 1982 / PAGE 36

Creating A Simple Word Processor

Steve Gradijan
Carrollton, TX

Editor's Note: With minor adjustments, this simple (but effective) word processor will work on Apple, OSI, — any Microsoft BASIC. Described here for the PET/CBM, the author points out which lines to change for other machines. The program is well documented to permit easy adjustment to a variety of printer, disk/tape, etc. configurations.


Arnie Lee's LED a Line-oriented Text Editor described in COMPUTE! #9 can become a moderately sophisticated word processor with the addition of a few lines. Line 5 enables upper and lower case features of the PET; line 8075 disengages these features and returns the PET to normal mode. Minor modification to line 9050 eliminates the printing of the LED's line oriented identification numbers and allows Commodore printers to print both upper and lower case. The addition of the control character to the string referred to in this line, however, uses one position of the 80 character string limiting the text part of the string to 79 characters, including spaces. Thus, Mr. Lee's 80 character string is shortened in line 10055.

Adding Versatility

Additional program lines give the word processor more versatility. Tab functions or line indentation and simulated line feed are accomplished by lines 145, 146, and 10045. Lines 9025 and 9055 provide the option for double spaced print of copy to the printer.

Lines 235 and 21000 to 21100 set the margins. If the margins are not set at the beginning of a typing session, the program defaults to a 79 character line i.e. no margins. Lines 500, 520, 530, and 570 are modified to accomodate the additional command "s," set margins.

A "bell" is provided to prompt you when only five spaces are left in a line (lines 22000 to 22040). It makes use of the "CB-2 sound" provided at the user port and requires connection of a suitable amplifier/speaker to the PET.

Lines 5 and 8075 are not necessary with the Commodore CBM's. The upper-lower case and bell functions use POKE statements not compatible with other computers. However, all other modifications should be usable with machines using Microsoft BASIC.

Options And Commands

Additional commands now available include "s" which allows setting margins. "n" establishes a 79 character line and no margins; "s" creates five character wide left and right margins and a 69 character wide field; "m" increases the size of the margins to ten characters and the "I" to fifteen characters in width. "o" allows creation of your own margins, both left and right. You are asked to specify the length of both the left and right margins. If you forget to set the margins at the beginning of the program the margins will default leaving you with a 79 character line. Once set, margins may later be lengthened, but never shortened!

The sub-commands "@" and "@" + RETURN provide tab functions and line skipping. The sub-command "@" adds five spaces to the text string and is useful as a tab or an indent. It may be used at any time while in a)ppend, i)ndent, or r)eplace functions. To skip a line of text, type "@" followed by the RETURN key.

The option to print the text either single or double spaced is given after requesting the print function p)rint.

The PET keyboard will behave like a normal typewriter after modifying the LED program. The shift key will provide upper case. All punctuation and designators supplied by the PET character set are available except @, which is used for tab functions. Quotation marks are permitted, but they look a little strange when first seen on the CRT screen of the PET. Ignore the funny appearance of anything that you enclose in quotes and depend upon the "bell" to determine the end of the line. Everything within quotes will appear normal when later listed, printed, or saved!

Delete lines 9070 through 9090 from Arnie Lee's original program and you are ready to type a letter, an order, an article for COMPUTE! or whatever.