Classic Computer Magazine Archive COMPUTE! ISSUE 20 / JANUARY 1982 / PAGE 89

Lower Case With Unmodified Apple

Joseph Wrubel
Aberdeen, NJ

This article describes a program called LC.EDIT which can be used to build, modify, and print text files using both upper and lower case letters on an unmodified 48K APPLE II Plus. The editor supports most of the commonly used edit commands including find, locate, change, append, insert and delete. Also included are read and write disk commands.

Uppercase letters are entered by preceding them with a CTRL-A. Internally, the program adds 32 to the ASCII value of each lower case letter, thus setting up the string for output to the printer. On the screen, capital letters are converted to the inverse mode while the lowercase letters are converted back to uppercase for display only.

I purchased my APPLE II early in December 1980, and quickly realized that the BASIC language had changed a lot since I had used it last in 1968. The biggest change I noticed was the string handling ability of the new BASIC.

The first application program I decided to write required the use of strings. I quickly found the "write text" and "read text" programs on the master disk and as quickly decided I didn't like them. At work, I make use of text editors on PRIME and UNIVAC computers and find that each of them has certain features which the other doesn't support. So I backed myself into writing a text editor for my APPLE and decided to incorporate the features I liked best from each system.

The program is used the first time to create a text file. The procedure is to hit a carriage return when prompted for "FILE NAME." This puts the program in the input mode. Once the text is entered, a CR puts the program into the EDIT mode. The options available in the EDIT mode are described below. Note that a single letter followed by a space and then any needed parameters is the usual format within the program. In this version, capital letters are typed in by preceding them with a CTRL-A.

The edit options are as follows:

I — Insert new line behind the present line.

C — Change the first sub-string to the second sub-string in this line of text. Sub-strings are separated by /'s. Double //'s can be used to enter a new substring in front of the existing string or to delete the last part of the original string.

A — Append new string to the end of the original string on this line.

P — Print a number of lines. Options include printing all lines from the present position to the end of the file by typing P*.

S — Save file. It is saved with its original name if one has been previously entered. Otherwise, a file name is requested via a prompt. If you give a file name when using S, the new name is used. This is a way of making an image of a text file for backup or modification.

N — If alone the next line is displayed. N +/- NUMB moves the pointer back and forth within file limits.

L — Locate sub-string at any location in any line from the present line to the end of the file.

Q — Quit. Normal program exit.

F — Find sub-string at beginning of any line from the present line to the end of file.

R — Retype present line completely.

H — Help if you have forgotten how to use the program. Can be used at any time.

E — Enter new file name to be edited. Can be used to edit when finished with the first without having to re-run the program.

NN — NN is any valid line number in the file. This is a direct line number access to the entire file.

The program is well REMarked to help any new programmer understand not only what the program does, but also how it does it.

The printer I have is an EPSON MX-80, but I believe this program will work for any printer which supports lower case characters. Until the day this article was written, I had no idea that I could take advantage of the printer's lower case abilities, but my son persisted. This program was modified from my original upper-case only version in about four hours.

One necessary feature of this program is the amount of user error-checking which takes place. As of this writing, I am unaware of any way to make the program bomb. Most of the checks were installed originally, but a few were added when bomb-outs indicated an unexpected pitfall such as typing "DELETE" instead of "D" to delete one line.