Donald B Trivette
The
Mysterious Editors
Recently I asked a group of computer users-mostly those with IBM PCs-how many used an editor. I got a blank stare. Most had only the vaguest idea of what an editor is and what you do with one-the consensus being that editors are either useless or redundant. (Self-preservation prevents me from making a comparison between the software and the profession.) No one confessed to actually owning an editor, yet everyone who has an IBM PC or PCjr has at least three of them.
An editor is a program that allows you to enter text, numbers, or other data (binary, hexadecimal, etc.) into the computer's memory; to display, modify, and change that data; and to store and retrieve it using an external device such as a disk drive. You may recognize that word-processing programs fall within this definition, for word processors are in fact very fancy editors. Most of the commands (and complications) of a word processor are for formatting and printing text in a pretty way-the actual editing commands are relatively few and easy to use.
The first editor IBM gives you is built into the hardware. It's a part of the BASIC language-the part that allows you to type BASIC statements and to move the cursor around the screen with the arrow keys. This is called full-screen editing. The BASIC editor comes up automatically when you turn on a PC or PCjr without a disk in the drive, or when you type BASIC (or BASICA) at the DOS A> prompt (the PCjr requires Cartridge BASIC in this case). It's a special-purpose editor designed to make entering and correcting BASIC statements easy, and it can't really be used for anything else. Nevertheless, it is an editor.
The second editor IBM gives its users is on the DOS disk and is named DEBUG. This is also a special-purpose editor. Using DEBUG, a programmer can follow the step-by-step execution of a machine language program and trace the contents of memory as it changes. DEBUG can also be used to display and change the contents of a file - particularly a program file containing machine language instructions. However, you must know something about machine language to use DEBUG effectively.
The third editor is one almost no one uses, although it too comes on the DOS disk. It's called EDLIN for LINe EDitor. The story goes that some programmers at Microsoft put together a quick and dirty editor for their own use while working on the then-secret IBM PC project. When IBM bought DOS and BASIC from Microsoft, the editor was shipped along by mistake. Supposedly some folks at IBM thought EDLIN was supposed to be a consumer product, so it was included on the DOS disk along with BASIC and DEBUG. What was intended to be an internal tool has now permeated thousands of homes and offices.
The Ugly Duckling
Neither Microsoft nor IBM is especially proud of EDLIN. It doesn't showcase the PC's power, so it remains the ugly duckling of IBM software: Still, it has many of the requisites for a general-purpose editor: You can use it to create, display, and modify a file, and you can use it to save and load files. If only it had a print command, it might have been the PC's first word processor. And if it supported fullscreen editing like BASIC, instead of primitive line-editing, it might be one of the PC's most popular programs. Still, it's not a totally useless editor-once you get used to it.
Some rainy Saturday, when you want to learn something new, take out your DOS disk and try EDLIN. The documentation is in the DOS manual, and you're likely to need it. Here are a few tips:
• At the A> prompt, type EDLIN and the name of the file you want to edit. EDLIN won't start unless you give it the name of a file, new or existing, when you start the program.
• The DOS disk is writeprotected, so either copy EDLIN to another disk or edit a file on drive B. For example, to edit a new file named ABC on the disk in drive B:, type EDLIN B:ABC.
• The asterisk (*) you'll see when EDLIN is active is the EDLIN prompt, just as A> prompts for DOS and Ok for BASIC.
• EDLIN comes up with the prompt. To begin entering input, type an I (for input mode) at the prompt.
• Line numbers are typed before editor commands. For example, to list lines 20 through 30, the command is 20,30L. This is exactly backward from BASIC.
There are some reasons, other than curiosity, to use EDLIN. It has so few commands (14) that it's super compact. The whole program is just 4600 bytes long. That means there's room for EDLIN on almost any disk, so you can always have an editor online to create a new BATCH file or even to quickly modify a text file. And because it's so small, there's lots of memory left for the file itself-an important consideration for PCjr users. More than once on the Junior I've had to use EDLIN to edit a file too large for my memory-hungry word processor. That's when an ugly duckling truly becomes a swan.
Donald B. Trivette is the author of Putting Jr to Work: A Guide to the IBM PCjr, published by COMPUTE! Books.