WORD PROCESSING POWER EXPLORED
by Bruce D. Noonan, M.D.
Some people think ST Writer is still the best word processor for the ST. Bruce Noonan certainly does. When the big wigs at Atari were ready to drop this mouseless text powerhouse, Dr. Noonan refused to let it die. He wrangled the source code from them and has spent the last year fixing bugs and adding features. His latest version, 1.50, is on your START disk in the folder STWRITER.STQ. What follows is a bit of the history of this unusual program and some tips, tricks, and techniques by one who knows.
Imagine a powerful 8-bit computer with 48 kilobytes of memory-but no word-processing software, and an unfortunate reputation as a "game machine". Sound familiar? For many of us Atari veterans, those days are not so far away. Back around 1980, Atari recognized the need for credible, practical software for their new Atari 800 computer, so they developed the Atari Word Processor. It set you back $100, and came in a large ring binder with two disks, volumes of documentation, and an audio-cassette teaching tape. Compared with today's word processors, the Atari Word Processor was a neanderthal. Each page of processed document required its own disk file, and every time something was edited, the entire document had to be re-formatted before saving and printing.
No wonder Atari owners turned to Letter Perfect, a word processor from UK. Letter Perfect was respectable and workable, but it used a nonstandard, incompatible disk format and cost $150- high for Atari software, even in those days. Next, Datasoft came out with Text Wizard, which was menu driven and produced Atari-compatible, standard ASCII files. But Text Wizard was hampered by inflexibility in printing. You could not specify a range of pages to print, and multiple copies had to be printed one at a time.
Atari hired the author of Text Wizard, William Robinson, to create AtariWriter and produced an overnight success. Not only was AtariWriter easy to use with only one menu screen, it was among the first Atari word processors to exploit the special features of the newer dot-matrix printers. The main drawback of AtariWriter was its lack of printer drivers, as Atari, Inc. clung to the narrow view that every Atari owner should only use Atari printers. Nevertheless, Consumer Reports rated AtariWriter, bundled with the new 800XL and the Atari 1027 printer, as the best word processing system for the price.
But after Jack Tramiel bought Atari from Warner Communications and developed the 16-bit 520 ST, Atari was again faced with the old game-computer reputation. Displaying six-color graphic screens ported over from the 8-bit machines would do little to dispel the myth.
JACK BE QUICK
The first word processor I saw for the ST was Express, from Mirage Concepts. One look at the old-fashioned, non-mnemonic control codes was enough for me. I wanted Atari Writer on the ST. Lo and behold, the new Atari Corp. was thinking along similar lines. A word processor was needed quickly to bundle with the new STs, Macintosh style.
Atari produced ST Writer remarkably quickly. Assembly language programmer, Dan Oliver, converted the code for the editor portion of the original AtariWriter, while John Feagans planned to adapt the formatter portion of the program in C. (The formatter is that part of a word processor that interprets editor commands and translates them into the proper format for the output device, whether it be the screen, printer, or disk.) Feagans returned from a one-week vacation to find that the only thing needed was his formatter and the package would he ready to go! In just two short weeks , ST Writer was born.
And what a word processor it was! It could do multiple pitch printing, double columns, headers, footers, multiple copies, expanded print, underlining, sub/superscripts, justification, block moves, deletes, inserts, search, replace. . . It even received AtariWriter files directly from an 8-bit Atari via an 850 interface and null-modem cable! Best of all, its commands were the familiar mnemonic codes used in Atari Writer.
NO ROSE GARDEN
As with many products rushed to market, ST Writer was not bug-free. The double-column printing would not work when double spacing with more than 80 columns (as with elite or condensed print). Furthermore, headers and footers couldn't be blocked right, and elongated printing did not center properly.
In September 1985, I spoke with Leonard Tramiel and Sig Hartmann at a Boeing Computer Society meeting in Seattle and asked them when the bugs
you create a
configuration file
for your printer,
you never have to
do it again.
in ST Writer would he fixed. The discouraging answer was that ST Writer was "complete," and besides, it was "free." Undaunted, I called Richard Frick at Atari, and was fortuitously steered toward John Feagans. John was unaware of the block-right header bug. He suggested I contact a couple of interested newsletter editors, Jack Durre, of Atari Journal in Miami, and Joe Waters of Current Notes in Washington DC.
As 1 spoke to Joe and Jack, I discovered that ST Writer had even more bugs. Among other things, both Joe and Jack needed condensed print in double-column format for their newsletters. I contacted John Feagans and asked if I could examine the ST Writer source code for bugs. In retrospect, this was quite presumptuous of me. I knew BASIC and 6502 assembler, but was only getting started in C, and had virtually no exposure to 68000 assembler. Surprisingly, Sig Hartmann said OK, and I began one of the most time consuming but educational challenges of my life. Eight revisions later...I'm still not sure ST Writer rev. 1.50 is complete, but I love it and am using it to write this article.
I DON'T DO WINDOWS
One reason I like ST Writer is that I don't have to take my hands off the keyboard and pet the mouse. I don't miss the GEM environment because all the AtariWriter commands are already deeply ingrained in my cerebrum. Besides, things like multiple windows confuse my simple mind, and I get lost trying to figure which window I should he in, or bow I got to the one where I am. To cut and paste between documents with ST Writer, I simply find the block, mark its beginning and end, and delete the block, thereby storing it in the copy buffer I then load the destination file, place the cursor in the right spot, and press [Undo] to paste the block. Alternatively, I could save the block to disk and merge it to the file wherever I want it. GEM drop-down menus are always getting in the way of my text anyway. Who needs them? (I know many of you disagree, so later I'll let you in on some of the plans for ST Writer 2.0.)
Atari was not enthralled with the idea that their premier ST word processor could not even use GEM, so the mouse-driven 1ST Word was acquired. I don't want to sound like a bigot, but I can't stand 1ST Word. The first version lacked multiple spacing, and the current version does not permit variable pitch print. I read about using fixed spaces, variable spaces, reformatting paragraphs, typing and editing modes (What? You mean they're not the same thing?). And I had a devil of a time trying to figure out why the print option on the drop-down wouldn't appear enabled when I wanted to print something. I had to learn about yet another mode: WP mode. Maybe I'm being too critical, but I'm also lazy. If I could learn to print with ST Writer in just five minutes, why shouldn't all word processors be so simple?
A BETTER MOUSETRAP
My frustration with First Word and GEM made me want to cage my mouse and improve ST Writer. I poured over the source code and first fixed the block-right header problem. Simple- the code pointed to the wrong array so I substituted the right one. I next fixed the expanded-print centering. Then the double-column bugs came in swarms. The blanks in the page image were initialized to 10-pitch width. With condensed print the blanks were too large and caused the second column to be shoved to the right. I fixed that only to find that now I overwrote the last line on the first column with blanks (sigh). On and on it went, but along came versions 1.04, 1.05, 1.06, and finally 1.07. I wont describe all the additions and changes in detail, but here is a list of them (in no particular order).
- Search for the printer-configuration file only once at the beginning.
- Outdenting of paragraphs (used in bibliographies).
- A mail-merge function.
- Enable large document size: 198 columns by 112 lines to accommodate wide carriages in condensed print and 14-inch legal sheets at 8 lines/inch.
- Conditional page eject.
- Type-over/Insert toggle.
- Keyboard access to second half of the ST character set.
- Alternate left- and right-blocked headers and footers.
- Enable an unformatted comment insertion in text.
- A "spooler" to print to disk (or RAMdisk) with printer controls embedded in text. Such files can be printed directly from the GEM Desktop.
- Send printer reset code each time a document is to be printed.
- Enable condensed elite text.
- Independent formatting of headers and footers.
- Fix print preview to prevent wrap.
- Insertion of controls to prevent use of odd numbers for vertical margins and spacing.
- Error message if you try to print or spool to a write-protected or unformatted disk.
- A new 432-byte printer-configuration file (accommodating up to eight control codes per function as needed for the new laser printers) and file creation program.
ST Writer's greatest
assets is its
ability to format
double-column
text.
- Elimination of the possibility for proportional print (too slow).
- Elimination of a word-wrap bug on boldfaced or italicized words.
I SHALL [Return]
One of the drawbacks of ST Writer is that it does not save standard ASCII files which can be printed to the screen from the Desktop. This came about to maintain compatibility with the original AtariWriter. AtariWriter was originally designed so that [Control][M] indicated one of the margins for double-column printing. The [Control][M] key combination generates an ASCII 13, which is nothing special on the old 8-bit Atari's, but is the standard code for carriage returns on the ST and most other microcomputers. (The oddball 8-bit Atari's used ASCII 155 for carriage return.) A compatible ST Writer couldn't use ASCII 13 for its carriage return, so ASCII zero (NULL) was used in its place. Saved ST Writer files thus contain zeros instead of ASCII 13 carriage returns and that is why you get a runaway screen when printing ST Writer files from the GEM Desktop. Recognizing this, the print-to-disk option was added to ST Writer so that such things as README.DOC ASCII files could be created to be read from the GEM Desktop.
What about the "DO RUN RUN" at the beginning of the saved files? Apparently the author saw something similar on a Macintosh, and thought it would be cute. The words hold no significance. It only flags the Index menu function so it recognizes and labels files that are in ST Writer format. Also, while you can merge an ST Writer-saved file into a file currently in memory, merging a non-ST Writer file will mess up your existing document. Instead, load the non-ST Writer file first, save it-thus converting it to ST file format-then merge it. Unlike many word processors, ST Writer has a utility to read and convert practically any type of file. As you may have experienced, it is very slow. However, with TOS in ROM and one megabyte of memory ST Writer can convert and edit larger files than either MINCE or Micro EMACS can handle. One more tip, while we're on the subject: To convert 1ST Word files to ST Writer, save the 1ST Word document in non-WP Mode before loading it into ST Writer. (Later, I'll show you how to get rid of all those extra carriage returns.)
PRINTER CONFIGURATION
ST Writer comes with a special printer configuration program called CONF1G.TOS. When run, CONFIG.TOS looks on disk for a file named CONFIG.TXT, and reads it into memory. CONFIG.TXT is nothing more than a saved ST Writer file containing all necessary printer codes for the user's individual printer. After reading CONFIG.TXT, CONFIG.TOS converts the text into special code and saves it back to disk, creating a file named XYZZX.DAT. The first time [P]rint is selected from the ST Writer menu, ST Writer searches on the disk it was booted from for XYZZX.DAT and uses its codes to properly interface with the printer.
Once you create an XYZZX.DAT file for your particular printer, you never need to go through it again. Be sure to make a backup copy- and remember where you put it. The only two files you need on any disk to operate ST Writer, are the STWRITER.PRG program itself and XYZZX.DAT
Some versions of ST Writer will also have a file called XYZZX.TXT. This is nothing more than a backup duplicate of CONFIG.TXT. Since we did not have space on the START disk to include this, be sure to create your own backup before altering CONFIG.TXT
Before I describe how to edit CONFIG.TXT for your printer, I must tell you ST Writer veterans that, yes, this is a whole new printer configuration system and, no, your earlier XYZZX.DAT file will not work with ver 1.50. Sorry.
OK, pull up your printer manual, load a backup copy of CONFIG.TXT into ST Writer and examine it. What you are looking at is very similar to program source code. Any line of text beginning with an asterisk (*) is a comment for your information only and is ignored by the CONFIG.TOS program. (Editor's note: The CONFIG.TXT file on your START disk contains the proper codes for a Star Micronics NX-10 printer which is, in most instances, compatible with Epson-compatible printers. If your printer falls into this category, leave everything as is and run CONFIG.TOS to create your XYZZX.DAT file.)
For the moment, let's skip over the first section of the file and edit a fairly simple example. Look for the comment: * underline on (you can use the ST Writer search command [F6]). Following * underline on are a list of numbers: 27, 45, 1, 255, 255, 255, etc. Each of these numbers is a printer code in decimal representing the command to turn on the underline. The 255's are fillers where there is no printer code number.
Look in your printer manual for the proper codes to turn on the underline. If your printer codes are listed in decimal-sometimes shown as CHR$(27), CHR$(45), CHR$(1)-you're
can do a limited
form of mail merge.
lucky. Printer codes are also often listed in hexadecimal or ASCII form. Hex is indicated by either a preceding dollar sign or by the presence of the letters A through F. The underline on codes above would appear in hexadecimal as: $1B, $2D, $01. In ASCII notation underline on would be: Esc, -, SOH. Whichever the case, if your printer codes are in hexadecimal you will need to convert them to decimal with a table, and if they are in ASCII, you will need an ASCII chart. Fortunately one chart in the back of your ST BASIC Sourcebook has all of these values. Also, many printer manuals have conversion charts.
Go down the line of CONF1G.TXT codes and replace any codes that disagree with those codes in your printer manual. If your printer requires, say four codes for a function that previously contained three, replace one of the 255's with the fourth code. Likewise, if your printer is one code short, replace the old, extra code number with a 255. It is very important that each function segment in CONFIG.TXT contains eight codes, so edit carefully. If you are uncertain about a particular function, leave it alone. Change as little as possible. You can always re-edit and try again.
Go back and look at the top of CONFIG.TXT A short chart at the top shows the necessary code numbers to use for certain parameters. It is set up for 80-column printers, but if you have at least 132 columns, substitute 8712 for 5280. This number is critical if you want more than 160 columns (condensed elite on an 80-column printer). You can get 198 columns (condensed on a 132-column printer) if you use the larger number (8712), but don't try printing more columns than your printer can handle.
The character translation table may appear confusing, but it merely lists the ASCII equivalent of all the characters in the character set, from 0 to 255. Unlike the remainder of CONFIG.TXT, these numbers are in hexadecimal (represented in this case by 0x ), so if you are not sure what they represent, see a table or the character set in your printer manual. Beyond the standard range of alphanumeric ASCII characters is an extra character set. The ST sees these extra characters as one thing (see again the chart in your ST BASIC Sourcebook ), but your individual printer sees them as another (depending on the printer). Many printers have their own special character set. The character translation table in CONFIG.TXT is designed to make the two jibe as much as possible.
Currently the table is set up for Atari printers. If you don't have an Atari printer, you won't have all the special characters, so you can configure your printer driver to print the characters you do have, even if they have a different ASCII number For example, my Star Micronics NX-10 printer has the paragraph symbol located at 0x14 (decimal 20), but on the ST, that symbol has the value 0xbc (decimal 188). I found 0xbc in the table and replaced it with 0x14. Now, every time I use the paragraph symbol in text to be printed, it will print as though I were using an Atari printer Don't bother changing table values below 0x20 because ST Writer uses those for formatting codes, and they will never be sent to your printer.
ST Writer tip: If your printer doesn't support underlining or bold printing, but does support back spacing, you can still get these features. Although undocumented, if you use 95 as the first number for underline on, followed by the backspace code (usually a decimal 8), the printer will print the underscore, backspace one space, then print a character over the underscore. For bold print, below the section labeled bold on, place your printer's back space code. This will print a character twice in the same place.
Up until this article, I had never noticed a certain bug that was brought to my attention by the editors at START: When using [Control][G] [number] [Space] to bold or italicize single words, any word that happened to get printed immediately after a linefeed would not be bolded (or italicized). To correct this, use a hyphen in place of the space after the Control-G-number combination. (Editor's note: This was one of several minor bugs which Dr. Noonan fixed immediately before press time. To indicate that this version of ST Writer was the final version, he added a zero to the version number, changing it from 1.5 to 1.50. If you have received your latest ST Writer from some other source, be sure to check your version number on the menu screen.
Once you have completed editing CONFIG.TXT, save it back to disk under the same name. Return to the GEM Desktop and make sure you have both CONFIG.TOS and the newly edited CONFIG.TXT on the same disk. Click and run CONFIG.TOS. In a short while, it will create a XYZZX.DAT file on your disk. Place this file on the same disk as STWRITER.PRG and you're ready to go. You might create a short ST Writer file which uses all the printer commands you wish to test. This way you can quickly try out the different functions and see how successful your edit has been.
DOUBLE YOUR PLEASURE
One of ST Writer's greatest assets is its ability to format double-column text. Set [Control][L] and [Control][R] for the left and right margin values of the first (lefthand) column, then use [Control][M] and [Control][N] for left and right margins, respectively of the second (righthand) column. The minimum value for the left margin of the first column is 1, and the maximum value of the right margin of the second column depends on which printer you are using. For an 80-column printer this would be 80 with pica (10 cpi) print. For condensed elite (20 cpi), this would be 160. Be sure that the first column's right margin doesn't extend past the second column's left margin or there will be trouble. Also, because different pitch characters have different widths, you cannot mix pitch with, say a 10 cpi word in a column of condensed print, since it will force the column margin to be moved right. Using elongated (double width) print is OK, however.
NOTHING UP MY SLEEVE
Here are a few tricks to navigate your way through ST Writer. To change drive paths (A:, B:, etc.) before your filename, you can either specify it every time, or choose [I]ndex from the menu and change the path name to the desired drive. ST Writer will remember this and use the new path as the default drive from then on. To access files within folders, type the backslash character (\) before and after the folder name, followed by the file name.
When downloading text files from a bulletin board, or converting 1ST Word files, you get a hard carriage return at the end of every line. Here is a simple procedure to clean up those files. Usually every line of such a file has one carriage return and every paragraph break consists of two. First, replace the pattern at every paragraph break with an unusual character not found in the document. (The vertical bar (|) just below the [Delete] key usually works. If you're unsure, do a search for it first.) Assuming a pattern of two carriage returns at each paragraph, the procedure would be: Press [Shift][F7], at the prompt press [Return] [Return] [Esc], at the second prompt, press [|][Esc]. Next, globally delete the remaining carriage returns. (In some files, you replace them with no character, and in others, with a space. Look in your document to see if spaces are next to the carriage returns.) Press [Shift][F7]. At the first prompt enter [Return] [Esc], and at the second enter [Esc]. Finally, to restore the paragraph breaks, press [Shift][F7], enter [|][Esc] at the first prompt, and [Return] [Return] [Esc] at the second. (If you want indented paragraphs, you might also enter a [Control][P] at the second prompt.
The above procedure will work with the majority of downloaded files, but it will mess up charts and tables. If your document has a lot of charts, use a Query Replace ([F7]) instead of a Global Replace ([Shift][F7]). It's slower, but safer.
Experiment with search-and-replace formatting. This is a powerful feature of ST Writer found in few other ST word processors. Version 1.50 of ST Writer also allows keyboard access to the special characters with ASCII values between hex 80 and hex FE [Alt][X] will let you print them to the screen.
MAIL MERGE
ST Writer can do a limited form of mail merge. This is handy for creating individualized letters from data lists. Let's say you wanted to send a duplicate mailing to two people, but also wanted to sound more personal than form letters normally allow. You could use ST Writer to create a database as follows:
Mr. John Q. Smith
212 Elm Street
Seattle, WA 98101
Johnny
Mrs. Elizabeth Bean
11323 Eighth Avenue South
Humptulips, WA 98377
Liz
Since the ST Writer merge system uses carriage returns to recognize
each data field (such as Name, or Street) it is very important that you
create a file with no extra carriage returns between records, or at the
beginning of the file. Also, most importantly the data file that will later
be read by ST Writer must be printed to disk using a special format. Set
the top and bottom margins to zero, the left margin to one, and the number
of lines per page to twice the number of lines in your record (eight for
the above). So the above file should start with: [Control][T][0] [Control][B][0]
[Control[[L][1] [Control][Y][8]. Now choose [P]rint from the menu, [D]isk
from the prompt, and enter a file name.
When you create your letter, use the Form Insert option ([F9] key) where each field item should appear For example:
December 4, l986[Return] [Return]Note that each of the lines of data will be used in order, and each line in the address file is terminated with a [Return]. If some of your addresses have four lines, you should make all the addresses with four lines. Use a [Return] without any characters in the fourth line position for three-line addresses. The fifth line with the first name or nickname is optional, but must be consistent from letter to letter.
[F9] [Return]
[F9][Return]
[F9][Return]
[Return]
Dear [F9],[Return]
[Control][P]It's time again for our annual Garden Club meeting. I certainly am looking forward to seeing you and renewing old acquaintances.
As you print your letter, you will be asked if you want to get your form insert data from a file (as opposed to typing each entry in by hand). Answer 'Y' and then, when prompted, give the correct file name. If the file does not exist, you will be placed into the manual entry mode. You can terminate the print-
on disk may be free
but I would pay for
a cartridge
version!
ing at this point by typing [Esc] and recheck the Index to get the correct filename.
You do not have to create your databases with ST Writer. You can use the mail splat from DB Master One, although you lose the flexibility of inserting nicknames in the text of your letter. This is a restriction of the database, not of ST Writer. Any database program which sorts and creates ASCII files will work with ST Writer, however.
PREVIEW OF COMING ATTRACTIONS
We are currently working on a version of ST Writer that will allow users to specify their preference for GEM or not. By clicking the left mouse button, the user may select GEM, and all GEM functions will be available. Desk accessories will be available from the menu bar, as well as all the normal Menu selections. Our objective is to make ST Writer compatible with Thunder!, the spelling checker from Batteries Included. One potential problem is printing text to the screen with the GEM v_gtext function. This is much slower than Bconout as is presently used, but v_gtext is needed to get clipping. (Clipping "clips" the screen display to within certain parameters-such as a window.) Our fear is that the v_gtext function will slow down ST Writer to an annoyance level. One of ST Writer's best features is its speed.
Other plans and dreams include an auto-index feature, or at least a block-alphabetizing routine. How about placing the GEM version on cartridge along with the CONFIG.TXT file? ST Writer on disk may be free, but I would pay for a cartridge version! I've thought about graphics merge; it would be very difficult, especially since ST Writer works in three different resolutions. I tried to program several ways of passing user-supplied printer control codes embedded in the text, but found it very difficult indeed. Besides, you could modify the printer configuration file to suit your needs regarding other fonts not supported by ST Writer by sacrificing such things as sub- and super-scripts. Adding additional columns has been suggested, but the programming would be a nightmare, as we would most likely have to rebuild ST Writer from the ground up. And what characters could we use to represent the third or fourth left and right columns? The entire alphabet has been used up for control codes, and I'm not anxious to make ST Writer as complicated as Word Star.
KEEP THOSE CARDS AND LETTERS COMING
If you like ST Writer and would like to have some other features added, let me or John Feagans know. If there are some other thoughts on how to improve the program, I would love to hear from you. My CompuServe number is 72407,504, or you might write me in care of START. I can't promise that we can or will implement your suggestion, but I'm open to suggestions. On the other hand, you could go out and pay for one of the newer word processor programs. . .