It always surprises me to see articles by talented laboratoriansdescribing the use of commercial microcomputer software or professionalprogrammers in situations where they could just as easily write theirown programs. In fact, MLO’s August and September Computer Dialogcolumns came out foursquare in favor of buying general purpose softwareand against developing BASIC programs. True, microcomputer software packages like Multiplan, Lotus 1-2-3,Scholar/Teach 3, and Visi-Calc are powerful and flexible programs. Butthat means they do a great deal more than most users really require.
They are also expensive, and it takes a lot of time to learn all theirfunctions. As for turning software development over to an expert, the troubleis that a professional programmer may not fully comprehend the needs ofthe laboratory. Or the programmer may not be available later when youneed help. If you want the microcomputer to perform special calculations,issue interpretations of results, or display case studies for staff andstudents, you can write the program. It’s not that difficult. Why do obviously bright people shy away from programming? The mainstumbling block is the boring and repetitive nature of the task. The microcomputer is incredibly stupid when it comes to receivinginstructions.
Every command must be properly spelled, punctuated, andnumbered or a frustrating “SYNTAX ERROR” message will appear.Nothing turns off an amateur programmer faster than a few “SYNTAXERROR” messages in a program he or she worked so hard to write. You can produce your own software with only a rudimentary knowledgeof BASIC and one store-bought program for word processing. I use anApple II Plus microcomputer and the Apple-writer II word processor(which turns the computer into a typewriter with a memory) to write andedit all my BASIC programs. Word processors have editing abilities that seem miraculous to thenew user. Some also can convert their ASCII text files into”soft” files that may be transmitted to other types ofcomputers via a modem. ASCII is a standard format for data interchange.So you could write programs at home on an IBM personal computer and sendthem through a modem to an Apple or even a minicomputer in thelaboratory.
Applewriter II is a very versatile processor with a glossaryfunction allowing storage and recall of text strings of up to 128characters by means of a few keystrokes. Other word processors havesimilar functions. The control command CTRL-G and a single character designating aparticular string enable you to reproduce simple or complex commandsfrom the glossary. It’s a quick, error-free way to insertconstantly repeated commands into a program you are writing. The following command string might recur throughout a casesimulation program: VTAB 12: HTAB 5: INVERSE: PRINT “THAT’SCORRECT”; N$: NORMAL: GOTO.
The vertical and horizontal tabinstructions at the beginning of the string position the message”That’s correct” on the computer screen.”INVERSE” means the message will be shown in dark lettersagainst a light background, the reverse of a normal display.”N$” adds the student’s first name to the message.”NORMAL” restores the screen’s dark background, and”GOTO” continues the program by directing the flow to anotherline in the program. If this command string is in a glossary preceded by a codecharacter, 1, it can then be placed in the program merely by holding theCTRL key and pressing G, which enters the glossary function, and thentyping the character 1. Applewriter will save the glossary as anindependent text file so that you can use it in other programs and addto it as your skills improve.
Writing the listing, or series of lines that make up a program, isnot at all difficult. Just use the word processor normally. Begin eachprogram line with a number, proceeding in increments of 10.
You canleave blanks for later numbering, and you also can amend the numbering.Do not exceed 256 characters per line, and end every line with acarriage return. This insures that the next line will be read as a newline, not as an extension of the previous one. The listing is saved by the word processor as a standard AppleASCII text file.
In order to execute the text file into a BASICprogram, you must leave the word processor and use the Applesoftlanguage. Applesoft is located in ROM (read only memory) and willautomatically become available when you exit the word processor. Duringexecution (type in EXEC and the file name), the listing will beinterpreted line by line until the Applesoft prompt reappears,indicating the computer is ready to accept commands. “SYNTAX ERROR” messages may appear during execution, mostlikely because a line was not numbered or a carriage return was omitted.These messages rapidly scroll off the screen as the computer reads thelisting. By typing in a RUN command, you get the computer to carry out theprogram.
If there are errors, Applesoft messages will now tell youwhere they are. If the program is free of flaws, it will run through tocompletion. Save the new program by typing SAVE and a file name. As a wordprocessor text file, it might be called TEST; as an Applesoft file youcan name it TEST 1.1.
Suppose you have an Applesoft program, acquired from someone elseor written by you, that you want to edit or append to another program.Convert that program into a standard Apple text file with thepreliminary commands shown in Figure I. The program will be written toyour file diskette as a text file using the file name selected. Yourword processor will be able to access this file and permit you to changeit. To convert the file back to an Applesoft program, execute it fromthe Applesoft BASIC environment and save the program under a modifiedname. This is a great way for Apple microcomputer users to reduce thetime and efofrt required for BASIC programming. If you type as slowlyas I do, the glossary function is especially welcome.
I’d like to hear from readers with different microcomputers asto whether my methods work on their systems. There are other techniquesthat simplify programmimg, and I may detail some of them in the future,but the point is that it’s not hard to do it yourself.