|Return to the archive home page|
SpeedScript 3.2 for the Commodore 64
Since its introduction in the January 1984 issue of COMPUTE!'s Gazette, SpeedScript has been the most popular program ever published by COMPUTE! Publications. Written entirely in machine language, SpeedScript contains nearly every command and convenience you'd expect from a quality word processor. The latest version of Commodore 64 SpeedScript, version 3.2, incorporates many improvements, readers' suggestions, and additional debugging. This version also works on a 128 in 64 mode.
SpeedScript 3.2, though compact in size (6K), has many features found on commercial word processors. SpeedScript is also very easy to learn and use. You can start writing with it the first time you use it. You type in everything first, preview and make corrections on the screen; insert and delete words, sentences, and paragraphs; and then print out an error-free draft, letting SpeedScript take care of things like margins, centering, headers, and footers.
SpeedScript is a writing tool. It won't necessarily make you a better writer, but you may become a better writer once the tedium of retyping and erasing is replaced by the flexibility of a word processor. Words are no longer frozen in place by ink; they become free-floating entities. You no longer think about typewriting-you can stand back and work directly with words and ideas. The distinction between rough and final drafts becomes blurred as you perfect your writing as you write.
Typing In SpeedScript
SpeedScript is one of the longest programs we've ever published, but it's well worth typing in. Since SpeedScript is a machine language program, it must be entered with the "MLX" machine language entry program found elsewhere in this issue. (If you already have a copy of SpeedScript 3.0 from the March 1985 issue of COMPUTE! or SpeedScript 3.1 from the book SpeedScript: The Word Processor for Commodore 64 and VIC-20, it's not necessary to retype the entire program. Skip to the section entitled "The SpeedScript Family" for simple modifications to update your copy to version 3.2.)
When you run MLX, you'll be prompted for a starting address and an ending address for the data you'll be entering. For SpeedScript 3.2, respond with the following values:
Starting Address: 0801
When you've finished typing in the data, save several copies to tape or disk before leaving MLX.
SpeedScript can be loaded just as if it were a BASIC program. If you load SpeedScript and list it, you'll see that it looks like a one-line BASIC program. This BASIC line is included to make the program easy to load, run, and copy. It's a good idea to save a couple of extra copies of SpeedScript, just in case the original is destroyed. To do this, type SAVE"SPEEDSCRIPT 3.2",8 (or ,1 if you're using tape) after loading SpeedScript, just as you would for a BASIC program. Use whatever filename you like (although "SPEEDSCRIPT" would be the best choice if you intend to use "SpeedScript Date And Time Stamper" found elsewhere in this issue).
Before using SpeedScript, you should unplug any cartridges and expanders. SpeedScript cannot take advantage of any custom hardware configurations except those that do not interfere with normal operations.
When you run SpeedScript, the screen colors change to dark gray on light gray except for the top screen line, which is black with white letters. This command line is used to communicate with SpeedScript. SpeedScript presents all messages here. The remaining lines of the screen are used to enter, edit, and display your document. The cursor shows where the next character you type will appear on the screen. SpeedScript lets you move the cursor anywhere within your document, making it easy to find and correct errors.
To begin using SpeedScript, just start typing. When the cursor reaches the right edge of the screen, it automatically jumps to the beginning of the next line, just as in BASIC. But unlike BASIC, SpeedScript never splits words at the right edge of the screen. If a word you're typing won't fit at the end of one line, it's instantly moved to the next line. This feature, called word-wrap, makes it much easier to read your text on the screen. Even if you make numerous editing changes, SpeedScript reformats the screen and rewraps all words.
Scrolling And Screen Formatting
When you finish typing on the last screen line, SpeedScript automatically scrolls the text upward to make room for a new line at the bottom. This is similar to the way BASIC works, but with one exception: The screen can scroll both up and down. Imagine the screen as a 24-line window on a long, continuous document.
More than 43K of text space is available in memory, room enough for 20-40 printed pages of text. To check at any time how much space is left, press CTRL-= (hold down the CTRL key while pressing the = key). The number which appears on the command line indicates how much room remains for characters of text.
If you're used to a typewriter, you'll have to unlearn some habits. First, since the screen is only 40 columns wide, and most printers have 80-column carriages, it doesn't make sense to press RETURN at the end of each line as you do on a typewriter. SpeedScript's word-wrap takes care of this automatically. Press RETURN only when you want to force a carriage return to end a paragraph or to limit the length of a line. So that you can see these forced carriage returns, they appear on the screen as leftpointing arrows (called return marks in this article).
When you print your document, SpeedScript automatically formats your text to fit the width of the paper. Don't manually space over for a left margin or try to center a line yourself as you would on a typewriter. SpeedScript's printing routine automatically takes care of all margins and centering and lets you customize the margin settings. Also, don't worry about where a printed page will end. When printing, SpeedScript automatically fits your text onto separate pages and can even put short phrases and page numbers at the top or bottom of each page if you want.
Like all good word processors, SpeedScript has a wide selection of editing and convenience features. You can move the cursor a single space in either direction, or skip to the next or previous word, sentence, or paragraph. You can also move the cursor to the top of the screen, the top of the document, or the end of the document. The INST/DEL key is used to insert a single space or delete a single chaacter. Other features let you erase a word, sentence, or paragraph, and move or copy sentences, words, and paragraphs to other places in your document. Using Search-and-Replace, you can find any phrase and even automatically change one phrase to another throughout the entire document.
You can save your text on tape or disk, then load it later for additions and corrections. You can' transpose (exchange) two characters, change the screen and text colors, send disk commands, read the disk error channel, and automatically tab over five spaces for paragraph indents. You don't need to learn all these commands right away, but you'll be glad they're available as you become more comfortable with word processing.
Using The Keyboard
Most of SpeedScript's features are accessed with control-key comands-you hold down CTRL while pressing another key. In this article, control-key commands are abbreviated CTRL-x (where x is the key you press in combination with CTRL). An example is the CTRL-= mentioned above to check on free memory. CTRL-E means hold down CTRL and press E. Sometimes you have to hold down both SHIFT and CTRL as you type the cornmand key, as in SHIFT-CTRLH. Other keys are referenced by name or function, such as back arrow for the left-pointing arrow in the top-left corner of the keyboard, pound sign for the British pound symbol, CLR/HOME for the home-cursor key, SHIFT-CLR/ HOME for the clear-screen key, f1 for special-function key 1, and up arrow for the upward-pointing arrow to the left of the RESTORE key.
Some keys let you move the cursor to different places in the document to make corrections or scroll text into view. SpeedScript uses a unique method of cursor movement that is related to writing, not programming. Programmers work with lines of text and need to move the cursor up and down a line or left and right across a line. SpeedScript, however, is oriented for writers. You aren't working with lines of text, but with a continuous document.
Therefore, SpeedScript moves the cursor by character, word, sentence, or paragraph. SpeedScript defines a word as any sequence of characters preceded or followed by a space. A sentence is any sequence of characters ending with a period, exclamation point, question mark, or return mark. And a paragraph is defined as any sequence of characters ending in a return mark. (Again, a return mark appears on the screen as a left-pointing arrow.)
Here's how to control the cursor:
- The left/right-cursor key works as usual; pressing this key by itself moves the cursor right (forward) one space, and pressing it with SHIFT moves, the cursor left (backward) one space.
- The up/down-cursor key moves the cursor forward to the beginning of the next sentence. Pressing it with SHIFT moves the cursor backward to the beginning of the previous sentence.
- The f1 function key moves the cursor forward to the beginning of the next word. The f2 key (hold down SHIFT and press f1) moves the cursor backward to the beginning of the previous word.
- The f3 function key moves the cursor forward to the beginning of the next sentence Oust like the up/ down-cursor key). The f4 key (hold down SHIFT and press f3) moves the cursor backward to the beginning of the previous sentence (just like pressing SHIFT and the up/down-cursor key).
- The f5 function key moves the cursor forward to the beginning of the next paragraph. The f6 key (hold down SHIFT and press 5) moves the cursor backward to the beginning of the previous paragraph.
- CLR/HOME, pressed once by itself, moves the cursor to the top of the screen without scrolling. Pressed twice, it moves the cursor to the beginning of the document.
- CTRL-Z moves the cursor to the bottom of the document.
Correcting Your Typing
One strength of a word processor is that you need never have mistakes in your printed document. Since you've typed everything before you print it, you have plenty of opportunities to proofread and correct your work. The easiest way to correct something is just to type over it, but there are other ways, too.
Sometimes you'll have to insert characters to make a correction. Maybe you accidentally dropped a letter, typing hngry instead of hungry. When you change the length of a word, you need to push over everything to the right of the word to make room for the insertion. Use SHIFT-INST/DEL to open up a single space, just as in BASIC. Merely position the cursor at the point where you want to insert a space, and press SHIFT-INST/DEL.
It can be tedious to use the SHIFT-INST/DEL key to open up enough space for a whole sentence or paragraph. For convenience, SpeedScript has an insert mode that automatically inserts space for each character you type. In this mode, you can't type over characters; everything is inserted at the cursor position. To enter insert mode, press CTRL-I. To cancel insert mode, press CTRL-I again. (This kind of command key, one which is used to turn something both on and off, is called a toggle). To let you know you're in insert mode, the normally black command line at the top of the screen turns blue.
Insert mode is the easiest way to insert text, but it can become too slow when you're working with a very long document because it must move all the text following the cursor position. Although SpeedScript uses turbocharged memory-move routines, the 6510 microprocessor can go only so fast. So SpeedScript has even more ways to insert blocks of text.
One way is to use the RUN/STOP key. It is programmed in SpeedScript to act as a five-space margin indent. To end one paragraph and start another, press RETURN twice and press RUN/STOP. Alternatively, you can press SHIFT-RETURN, which does this automatically. You can use RUN/STOP to open up more space than SHIFT-INST/DEL. No matter how much space you want to insert, each insertion takes the same amount of time. So the RUN/STOP key can insert five spaces five times faster than pressing SHIFT-INST/DEL five times.
There's an even better way, though. Press SHIFT-RUN/STOP to insert 255 spaces. This is enough room for a sentence or two. You can press it several times to open up as much space as you need. And SHIFT-RUN/STOP is fast. (You don't want to be in insert mode when you use this trick; that would defeat its purpose.)
Since the INST/DEL key is also slow when you're working with large documents (it, too, must move all text following the cursor), you may prefer to use the back-arrow (-) key to backspace. The back-arrow key by itself moves the cursor left one space and blanks out that position. It's more like a backspace than a delete.
After you're finished inserting with these methods, there will probably be some inserted spaces left over that you didn't use. Just press SHIFT-CTRL-back arrow. This instantly deletes all extra spaces between the cursor and the start of the following text. SHIFT-CTRL-back arrow is also generally useful whenever you want to delete a bunch of spaces.
Inserting and retyping are not the only kinds of corrections you'll need to make. Part of writing is separating the wheat from the chaff. On a typewriter, you pull out the paper and throw it away. SpeedScript lets you be more selective.
Press the INST/DEL key by itself to erase the character to the left of the cursor. All the following text is pulled back to fill the vacant space.
Press CTRL-back arrow to delete the character on which the cursor is sitting. Again, all the following text is moved toward the cursor to fill the empty space.
These keys are fine for minor deletions, but it could take a long time to delete a whole paragraph this way. So SpeedScript has two commands that can delete an entire word, sentence, or paragraph at a time. CTRL-E erases text after (to the right of) the cursor position, and CTRL-D deletes text behind (to the left of) the cursor.
To use the CTRL-E (erase) mode, first place the cursor at the beginning of the word, sentence, or paragraph you want to erase. Then press CTRL-E. The command line shows the message Erase (S,W,P): RETURN to exit. Press S to erase a sentence, W for a word, or P for a paragraph. Each time you press one of these letters, the text is quickly erased. You can keep pressing S, W, or P until you've erased all the text you wish. Then press RETURN to exit the erase mode.
The CTRL-D (delete) mode works similarly, but deletes only one word, sentence, or paragraph at a time. First, place the cursor after the word, sentence, or paragraph you want to delete. Then press CTRL-D. Next, press S, W, or P for sentence, word, or paragraph. The text is immediately deleted and you return to editing. You don't need to press RETURN to exit the CTRL-D mode unless you pressed this key by mistake. (In general, you can escape from any command in SpeedScript by simply pressing RETURN.) CTRL-D is most convenient when the cursor is already past what you've been typing.
The Text Buffer
When you erase or delete with CTRL-E and CTRL-D, the text isn't lost forever. SpeedScript remembers what you've removed by storing deletions in a separate area of memory called a buffer. The buffer is a fail-safe device. If you erase too much or change your mind, just press CTRL-R to restore the deletion. However, be aware that SpeedScript remembers only the last erase or delete you performed.
Another, more powerful use of this buffer is to move or copy sections of text. To move some text from one location in your document to another, first erase or delete it with CTRL-E or CTRL-D. Then move the cursor to where you want the text to appear and press CTRL-R. CTRL-R instantly inserts the contents of the buffer at the cursor position. If you want to copy some text from one part of your document to another, just erase or delete it with CTRL-E or CTRL-D, restore it at the original position with CTRL-R, and then move the cursor elsewhere and press CTRL-R to restore it again. You can retrieve the buffer with CTRL-R as many times as you like.
Important: The CTRL-E erase mode lets you erase up to the maximum size of the buffer (12K, or over 12,000 characters). CTRL-E normally removes the previous contents of the buffer each time it is used. Keep this in mind if there's something in the buffer you'd rather keep. If you don't want the current buffer contents to be erased, press SHIFT-CTRL-E instead. This preserves the buffer contents and adds newly erased text to the buffer.
Now you can see why CTRL-D lets you delete only a single sentence, word, or paragraph at a time. If it didn't, the deleted text would be added to the end of the buffer, and when you pressed CTRL-R to retrieve the buffer, the deleted text would be out of order (since CTRL-D deletes backward).
If you ever need to erase the contents of the buffer, press CTRL-K (remember kill buffer).
It's relatively easy to move blocks of text between documents. Using the buffer, you can load one document, erase some text into the buffer, load another document, and then insert the buffer contents into the new document. You can also use the buffer to save an often-used word or phrase, then repeat it whenever you need it.
Starting From Scratch
If you want to start a new document or simply obliterate all your text, press SHIFT-CLR/HOME. SpeedScript asks, ERASE ALL TEXT. Are you sure? (Y/N). This is your last chance. If you don't want to erase the entire document, press N or any other key. Press Y to perform the irreversible deed. There is no way to recover text wiped out with Erase All.
The RUN/STOP-RESTORE reset combination on the Commodore 64 has been disabled in SpeedScript.
As mentioned above, pressing RUN/STOP by itself inserts five spaces for indenting paragraphs.
Pressing just RESTORE brings up the message Exit SpeedScript: Are you sure? (YIN). If you press Y for yes, you exit to BASIC. (If you press N or any other key at the prompt, you return to editing text with no harm done.) Once in BASIC you'll still have one chance to reenter SpeedScript without losing your text-simply enter RUN and your text should be intact when SpeedScript is restarted. (Your chances of recovering text decrease if you execute other commands while in BASIC.)
Here's another feature only a computer can bring to writing. SpeedScript has a Hunt command that searches through your document to find a selected word or phrase. A Replace option lets you automatically change one word to another throughout the document. Since on the 64, CTRL-S is synonymous with the CLR/HOME key (try it), and since SpeedScript already uses CTRL-R, several command keys which are slightly less than mnemonic have been designated for these functions.
SHIFT-CTRL-H activates the Hunt feature, SHIFT-CTRL-J (J is used because it's next to the H) lets you selectively hunt and replace, and CTRL-G (Global) is for automatically searching and replacing.
Searching for something is a two-step process. First, you need to tell SpeedScript what to search for, then you must trigger the actual search. Press SHIFT-CTRL-H. The command line says Hunt for:. Type in what you'd like to search for-the search phrase-up to 29 characters. SpeedScript remembers the search phrase until you change it. (Incidentally, when you are typing on the command line, the only editing key that works is INST/DEL for backing up. SpeedScript does not let you enter control codes or cursor controls when you're typing on the command line.) Press RETURN after you've entered the search phrase. If you press RETURN alone without typing anything, the Hunt command is canceled.
When you're ready to search, press CTRL-H (without the SHIFT). SpeedScript looks for the next occurrence of the search phrase starting from the current cursor position. If you want to hunt through the entire document, press CLR/HOME twice to move the cursor to the very top before beginning the search. Each time you press CTRL-H, SpeedScript looks for the next occurrence of the search phrase and places the cursor at the start of the phrase. If the search fails (if the search phrase isn't found before the end of the document), you'll see the message Not Found.
CTRL-J (Replace) works together with CTRL-H. After you've specified the search phrase with SHIFT-CTRL-H, press. SHIFT-CTRL-J to select the replace phrase. SpeedScript also remembers this replace phrase until you change it. You can press RETURN alone at the Replace with: prompt to select a null replace phrase. When you hunt and replace, this deletes the located phrase. To search and replace manually, start by pressing CTRL-H. After SpeedScript has found the search phrase, press CTRL-J (without SHIFT if you want to replace the phrase. If you don't want to replace the phrase, don't press CTRL-J. You are not in a special search-and-replace mode. You're free to continue writing at any time.
CTRL-G links CTRL-H and CTRL-J together. It first asks Hunt for:, then Replace with:, and then automatically searches and replaces throughout the document starting at the cursor position.
A few hints and cautions: First, realize that if you use the as the search phrase, SpeedScript dutifully finds the embedded the in words like therefore and heathen. If you changed all occurrences of the to cow, these words would become cowrefore and heacown. If you want to find or replace a single word, include a space as the first character of the word, since almost all words are preceded by a space. Naturally, if you are replacing, you need to include the space in the replace phrase, too. Also, SpeedScript distinguishes between uppercase and lowercase. The word Meldids does not match with meldids. SpeedScript will not find a capitalized word unless you capitalize it in the search phrase. To cover all bases, you will sometimes need to make two passes when replacing a word. Keep these things in mind when using CTRL-G since you don't have a chance to stop an out-of-control search-and-replace.
Storing Your Document
Another advantage of word processing is that you can store your writing. A Commodore disk, with 170K of storage space, can store 80-150 pages of text as several document files. Tapes also have great storage capability-but they're slower.
It's easy to store a document. First, make sure your cassette or disk drive is plugged in and functioning. Insert a tape or disk into the drive. Press the f8 function key (SHIFT-f7). You'll see the prompt Save:. Type in a filename for your document. A filename can be up to 16 characters long and can include almost any characters, but do not use question marks or asterisks. You cannot use the same name for two different documents on a single disk. To replace a document already on disk using the same filename, precede your filename with the characters @0: or @:. You can also precede the filename with either 0: or 1: if you use a dual disk drive. SpeedScript cannot access a second disk drive with a device number of 9.
After entering the filename, answer the prompt Tape or Disk by pressing either the T or D key. You can cancel the Save command by pressing RETURN without typing anything else at either the Save: or Tape or Disk prompt.
After you press T for tape, press RECORD and PLAY simultaneously on the cassette drive. SpeedScript begins saving. If you press D for disk, your file is stored relatively quickly (if the disk is formatted and has room), After the Save, SpeedScript reports No errors if all is well, or reads and reports the disk error message otherwise.
The Commodore 64 is not able to detect errors during a tape Save, so SpeedScript provides a verify command. Rewind the tape, press CTRL-V, and then type the filename. Press T for tape, press PLAY on the recorder. SpeedScript will notify you if there is an error.
Loading A Document
To recall a previously saved document, press the f7 function key. Answer the Load: prompt with the filename. Insert the tape or disk with the file you want to load and press T or D. Press PLAY if you're using tape. SpeedScript loads the file and should display No errors. Otherwise, SpeedScript reads the error channel of the disk drive or reports Load error for tape.
It's important to position of the cursor correctly before loading a file. SpeedScript starts loading at the cursor position, so be sure to press CLR/HOME twice or SHIFT-CLR/ HOME (Erase All) to move the cursor to the start of text space, unless you want to merge two documents. When you press f7 to load, the command line turns green to warn you if the cursor is not at the top of the text space.
To merge two or more files, simply load the first file, press CTRL-Z to move the cursor to the end of the document, and then load the file you want to merge. Do not place the cursor somewhere in the middle of your document before loading. A Load does not insert the characters coming in from tape or disk into your old text, but overwrites all existing text after the cursor position. The last character loaded becomes the new end-of-text marker, and you cannot access any of your old text that may appear after this marker.
Sometimes you forget the name of a file or need to scratch or rename a file. SpeedScript gives you full control over the disk drive. To view the disk directory, press CTRL-4. The directory will be displayed on the screen without affecting the text in memory. Press any key to pause scrolling. Afterward, press RETURN to switch back to your text. All the other disk commands are also accessible. Just press CTRL-(up arrow); then type in a 1541 disk command. You don't need to type PRINT# 15 or any quotation marks as you do in BASIC-just the actual command. If you press RETURN without typing a disk command, SpeedScript displays the disk status. It also displays the status after completing a disk command. Here is a quick summary of disk commands:
n:disk name,ID This formats (NEWs) a disk. You must format a new disk before using it for the first time. The disk name can be up to 16 characters. The ID (identifier) is any two characters. You must use a unique ID for each disk you have. Don't forget that this command erases any existing data on a disk.
s.filename Scratches (deletes) a file from the disk.
r:newname=oldname Changes the name of file oldname to newname.
c:backup filename=original name Creates a new file (the backup copy) of an existing file (original copy) on the same disk.
i: Initializes a disk. This resets several disk variables and should be used after you swap disks or when you have trouble reading a disk.
v: Validates a disk. This recomputes the number of available blocks and can sometimes free up disk space. Always use Validate if you notice a filename on the directory flagged with an asterisk. Validate can take awhile to finish.
uj: Resets the disk drive to power-up state.
SpeedScript has a few commands that don't do much, but are still nice to have. CTRL-X exchanges the character under the cursor with the character to the right of the cursor. Thus, you can fix transposition errors with a single keystroke. CTRL-A changes the character under the cursor from uppercase to lowercase or vice versa. You can hold down CTRL-A to continue changing the following characters.
Press CTRL-B to change the background and border colors. Each time you press CTRL-B, one of 16 different background colors appears. Press CTRL-L to cycle between one of 16 character (lettering) colors. The colors are preserved until you change them. In fact, if you exit and resave SpeedScript, the program will load and run with your color choice in the future.
If you already think SpeedScript has plenty of commands, wait until you see what the printing package offers. SpeedScript supports an array of powerful formatting features. It automatically fits your text between left and right margins that you can specify. You can center a line or block it against the right margin. SpeedScript skips over the perforation on continuous-form paper, or it can wait for you to insert singlesheet paper. A line of text can be printed at the top of each page (a header) and/or at the bottom of each page (a footer), and it can include automatic page numbering, starting with whatever number you like.
SpeedScript can print on different lengths and widths of paper, and single-, double-, or triplespacing (or any spacing for that matter) is easy. You can print a document up to the size that can be held on a disk or tape by linking several files together during printing. You can print to the screen or to a sequential disk file instead of to a printer. Other features let you print to most printers using most printer interfaces, and send special codes to the printer to control features like underlining, boldfacing, and doublewidth type (depending on the printer).
But with all this power comes the need to learn additional commands. Fortunately, SpeedScript sets most of these variables to a default state. If you don't change these settings, SpeedScript assumes a left margin of 5, a right-margin position of 75, no header or footer, single-spacing, and continuous-paper page feeding. To begin printing, simply press CTRL-P. If your printer is attached, powered on and selected (online), SpeedScript begins printing immediately. To cancel printing, hold down the RUN/STOP key until printing stops.
Before printing, be sure the paper in your printer is adjusted to top-of-form (move the paper perforation just above the printing element). CTRL-P assumes a Commodore printer, so it's helpful if your interface simulates the modes and codes of the Commodore 1525, 1526, or MPS-801, -802, or -803 printers. CTRL-P prints with a device number of 4 and a secondary address of 7 (uppercase/ lowercase mode).
If CTRL-P doesn't work for you, try another variation, SHIFT-CTRL-P. Answer the prompt Print to: Screen, Disk, Printer? with the single letter S, D, or P. Press any other key to cancel the command.
If you press P for printer, SpeedScript requests two more keystrokes. First, answer the Device number prompt with a number from 4 through 7. This lets you print to one of several printers addressed with different device numbers. Next, answer the Secondary address prompt with a number from 0 through 9.
The secondary address is used on most non-Commodore printer interfaces to control special features. For example, you can bypass the emulation features and use graphics mode to communicate directly with your printer (see the true ASCII command below). Consult the list of secondary addresses in your printer interface manual. SpeedScript does not work properly with RS-232 serial printers or interfaces.
An additional note: Some printers and interfaces incorporate an automatic skip-over-perforation feature. The printer skips to the next page when it reaches the bottom of a page. Since SpeedScript already controls paper feeding, you need to turn off this automatic skip-over-perf feature (usually, by sending out control codes) before running SpeedScript, or paging won't work properly. Remember, sometimes the printer controls the skip-over-perf feature, sometimes the interface, and sometimes even both.
The Commodore 64 version of SpeedScript has been tested with the following printers: Commodore 1525 and 1526; MPS-801, -802, and -803; C. Itoh Prowriter 8510; Epson MX-80; Gemini 10-X; Star SG-10, SG-10C, and SD-10; Okimate 10 and 20; Okidata 82 and 92; and Hush-80 CD. SpeedScript has also been tested with these printer interfaces: Cardco A/B/G + and G Wiz, Tymac Connection, Xetec, TurboPrint, and MW-350. SpeedScript should work even if your printer or interface is not on this list. These are just the ones that have been tested.
Be sure your printer or interface supplies its own linefeeds. Again, consult your manuals and ensure that either your printer or interface (but not both) supplies an automatic linefeed after carriage return. To test this, print a small sample of text with CTRL-P. Since the default is single-spacing, you should not see double-spacing, nor should all printing appear on the same line. If you still aren't getting linefeeds, use the linefeed command discussed below.
Printing To Screen And Disk
SHIFT-CTRL-P prints to the screen when you press S. The screen colors change to white letters on a black background, and what appears on the screen is exactly what would print on the printer. It takes two screen lines to hold one 80-column printed line, of course. If you use double-spacing (see below), it's much easier to see how each line is printed. With this screen preview, you can see where lines and pages break. To freeze printing, hold down either of the SHIFT keys, or engage SHIFT LOCK. The border color changes to white while SHIFT is held down. When printing is finished, press any key to return to editing.
SHIFT-CTRL-P prints to a disk file when you press D. Enter the filename when it's requested. SpeedScript sends out all printer information to a sequential file. You can use other programs to process this formatted file. Try this simple example:
10 OPEN 1,4
This program dumps the disk file specified, by the filename in line 20 to any printer. You can use it to print SpeedScript files (produced with SHIFT-CTRL-P) on another Commodore computer and printer without running SpeedScript. Change line 10 to OPEN 1,2,0, CHR$(6) to dump the file to a 300-baud modem or RS-232 printer, or OPEN 1,3 to display it on the screen.
The print-formatting commands must be distinguished from normal text, so they appear onscreen in reverse field with the text and background colors switched. You enter these reverse-video letters by pressIng CTRL-(pound sign) or CTRL-3, which is easier to type with one hand. Answer the prompt Enter format key: by pressing a single key. This key is inserted into text in reverse video. All lettered printer commands should be entered in lowercase (unshifted). During printing, SpeedScript treats these characters as printing commands.
There are two kinds of printing commands, which will be called stage 1 and stage 2. Stage 1 commands usually control variables such as left margin and right margin. Most are followed by a number, with no space between the command and the number. Stage 1 commands are executed before, a line is printed.
Stage 2 commands, like centering and underlining, are executed while the line is being printed. Usually, stage 1 commands must be on a line of their own, although you can group several stage 1 commands together on a line. Stage 2 commands are by nature embedded within a line of text. A sample stage 1 line could look like this:
Embedded stage 2 commands look like this:
[c]This line is centered.<-
Stage 1 Commands
l Left margin. Follow with a number from 0 to 255. Use 0 for no margin. Defaults to 5. See Figure 2 for an illustration of margin settings.
r Right margin position, a number from 1 to 255. Defaults to 75. Be sure the right-margin value is greater than the left-margin value, or SpeedScript will become extremely confused. Some printer interfaces force a certain printing width, usually 80 characters wide. You'll need to disable this in order to permit SpeedScript to print lines longer than 80 characters.
t Top margin. The position at which the first line of text is printed, relative to the top of the page. Defaults to 5. The header (if any) is always printed on the first line of the page, before the first line of text.
b Bottom margin. The line at which printing stops before continuing to the next page. Standard 8 1/2 x 11-inch paper has 66 lines on most printers (6 vertical lines of text per inch is standard for Commodore printers). Bottom margin defaults to the fifty-eighth line. The footer (if any) is always printed on the last line of the page, after the last line of text.
p Page length. Defaults to 66. If your printer does not print six lines per inch, multiply lines-per inch by 11 to get the page length. European paper is usually longer than American paper-11 5/8 or 12 inches. Try a page length of 69 or 72.
s Spacing. Defaults to singlespacing. Follow with a number from 1 to 255. Use 1 for single-spacing, 2 for double-spacing, and 3 for triple-spacing.
@ Start numbering at page number given. Page numbering normally starts with 1.
? Disables printing until selected page number is reached. For example, a value of 3 would start printing the third page of your document. Normally, SpeedScript starts printing with the first page.
x Sets the page width, in columns (think a cross). Defaults to 80. You need to change this for the sake of the centering command if you are printing in double-width or condensed type, or if you're using a 40-column or wide-carriage printer.
n Forced paging. Normally, SpeedScript prints the footer and moves on to the next page only when it has finished a page, but you can force it to continue to the next page by issuing this command. It requires no numbers.
m Margin release. Disables the left margin for the next printed line. Remember that this executes before the line is printed.
a True ASCII. Every character is assigned a number in the ASCII (American Standard Code for Information Interchange) character set. Most printers use this true ASCII standard, but Commodore printers exchange the values for uppercase and lowercase to match Commodore's own variation of ASCII. Some printer interfaces do not translate Commodore ASCII into true ASCII, so you need to use this command to tell SpeedScript to translate. Also, you will sometimes want to disable your interface's emulation mode intentionally in order to control special printer features that would otherwise be rejected by emulation. Place this command as the first character in your document, even before the header and footer definitions. Don't follow it with a number.
Since, in effect, the true ASCII command changes the case of all letters, you can type something in lowercase and use true ASCII to make it come out in uppercase.
w Page wait. Like the true ASCII command, this one should be placed at the beginning of your document before any text. With Page wait turned on, SpeedScript prompts you to Insert next sheet, press RETURN when each page is finished printing. Insert the next sheet, line it up with the printhead, and then press RETURN to continue. Page wait is ignored during disk or screen output.
j Select automatic linefeeds after carriage return. Like a and w, this command must be placed before any text. Don't use this command to achieve double-spacing, but only if all text prints on the same line.
i Information. This works like REM in BASIC. You follow the command with a line of text, up to 255 characters, ending in a return mark. This line will be ignored during printing, it's handy for making notes to yourself such as the filename of the document.
h Header define and enable. The header must be a single line of text ending with a return mark (up to 254 characters). The header prints on the first line of each page. You can include stage 2 commands such as centering and page numbering in a header. You can use a header by itself without a footer. The header and footer should be defined at the top of your document, before any text. If you want to prevent the header from printing on the first page, put a return mark by itself at the top of your document before the header definition.
f Footer define and enable. The footer must be a single line of text ending in a return mark (up to 254 characters). The footer prints on the last line of each page. As with the header, you can include stage 2 printing commands, and you don't need to set the header to use a footer.
g Go to (link) next file. Put this command as the last line in your document. Follow the command with the letter D for disk or T for tape, then a colon (:), and finally, the name of the file to print next. After the text in memory is printed, the link command loads the next file into memory. You can continue linking in successive files, but don't include a link in the last file. Before you start printing a linked file, make sure the first of the linked files is in memory. When printing is finished, the last file linked to will be in memory.
Stage 2 Commands
These commands either precede a line of text or are embedded within one.
c Centering. Put this at the beginning of a line you want to center. This will center only one line, ending in a return mark. Repeat this command at the beginning of every line you want centered. Centering uses the page-width setting (see above) to center the line properly. To center a double-width line, either set the page width to 40 or pad out the rest of the line with an equal number of spaces. If you use double-width, remember that the spaces preceding the centered text will be double-wide spaces.
e Edge right. This command will cause a line to be aligned with the right margin when it is printed. That is, spaces will be inserted in front of the line so that the last character in the line will be printed at the right margin. Place the command at the beginning of the line you want aligned; it will only affect one line at a time, each ending with a return mark. Repeat this command at the beginning of every line you want aligned to the right. Note that this is not the same as right justification-a feature found on some word processors that adjusts printing to align both the left and right margins-since the edge-right command aligns only one line, and only at the right margin. SpeedScript has no right-justification feature.
# When SpeedScript encounters this command, it prints the current page number. You usually embed this within a header or footer.
u A simple form of underlining. It does not work on Commodore printers, but only on printers that recognize CHR$(8) as a backspace and CHR$(95) as an underline character. Underlining works on spaces, too. Use the first u to start underlining and another one to turn off underlining.
Fonts And Styles
Most dot-matrix printers are capable of more than just printing text at ten characters per inch. The Commodore MPS-801 can print in double-width and reverse field. Some printers have several character sets, with italic and foreign language characters. Most can print in double-width (40 characters per line), condensed (132 characters per line), and in either pica or elite. Other features include programmable characters, programmable tab stops, and graphics modes. Many word processors customize themselves to a particular printer, but SpeedScript was purposely designed not to be printer-specific. Instead, SpeedScript lets you define your own stage 2 printing commands.
You define a programmable printkey by choosing any character that is not already used for other printer commands. The entire uppercase alphabet is available for printkeys, and you can choose letters that are related to their function (like D for double-width). You enter these commands like printer commands, by first pressing CTRL-3.
To define a printkey, just press CTRL-3, then the key you want to assign as the printkey, then an equal sign (=), and finally the ASCII value to be substituted for the printkey during printing. For example, to define the + key as the letter z, you first look up the ASCII value of the letter z (in either your printer manual or user's manual). The ASCII value of the letter z is 90, so the definition is [+]=91<
Now, anywhere you want to print the letter z, substitute the printkey:
Gad[+]ooksl The [+]oo is [+]any!
This will appear on paper as
Gadzooks! The zoo is zany!
More practically, look up the value of reverse-on and reverse-off. Reverse-on, a value of 18, prints all text in reverse video until canceled by reverse-off (a value of 146) or a carriage return. So, define SHIFT-R as 18 and SHIFT-O as 146. Anywhere you want to print a word in reverse, bracket the word with printkey R and printkey O.
You can similarly define whatever codes your printer uses for features like double-width or emphasized mode. For your convenience, four of the printkeys are predefined, though you can change them. Printkey 1 is defined as a 27, the value of the ESCape code used to precede many two-character printer commands. (With some printer interfaces, you must send two ESCape codes to bypass the interface's emulation.) For example, the Epson command for double strike is ESC-G. You can select it in SpeedScript with
Printkey 2, a value of 14, goes into double-width mode on most printers, and printkey 3, a value of 15, turns off double-width on some printers and selects condensed mode on others. Printkey 4 is defined as 18, which selects reverse field with Commodore printers (and on some graphics interfaces in emulation mode) or condensed mode on some other printers.
With so many codes available, you can even design custom logos and symbols using your printer's graphics mode. For example, on the 1525/MPS-801, you can draw a box (perhaps for a checklist) by first setting the appropriate codes:
Then display the box with text by typing
This appears on paper as
Keep one thing in mind about printkeys. SpeedScript always assumes it is printing to a rather dumb, featureless printer, the least common denominator. SpeedScript doesn't understand the intent of a printkey; it just sends its value out. So if you make one word within a line double-width, it may make the line overflow the specified right margin. There's no way for SpeedScript to include built-in font and type-style codes without being customized for a particular printer, since no set of codes is universal to all printers.
It may take you awhile to fully master SpeedScript, but as you do you'll discover many ways to use the editing and formatting commands. For example, there is a simple way to simulate tab stops, say, for a columnar table. Just type a period at every tab-stop position. Erase the line; then restore it multiple times. When you are filling in the table, just use word-left/word-right to jump quickly between the periods. Or you can use the programmable printkeys to embed your printer's own commands for setting and jumping to tab stops.
SpeedScript can also be used as a simple database manager. Type in the information you need; then store it as a SpeedScript document. The search feature lets you quickly find information, especially if you use graphics characters to flag key lines. You can search for the graphics characters and quickly skip from field to field.
You don't have to change or define printer commands every time you write. Just save these definitions as a small text file, and load this file each time you write. You can create many custom definition files and have them ready to use on disk. You can create customized "fill in the blank" letters. Just type the letter, and everywhere you'll need to insert something; substitute a graphics symbol. When you're ready to customize the letter, just hunt for each graphics symbol and insert the specific information.
SpeedScript does not work with any 80-column video boards or software 80-column emulators. SpeedScript also wipes out most kinds of resident (RAM-loaded) software, including most software-simulated printer drivers. However, you can print to disk using SHIFT-CTRL-P, and then dump the disk file to the printer from BASIC.
SpeedScript documents are stored as program files (PRG type on disk). Naturally, you can't load and run a SpeedScript file from BASIC. The characters are stored in their screen code (POKE) equivalents. Several commercial word processors store text similarly, including WordPro 3 + and PaperClip. As a matter of fact, two commercial spelling checkers designed for WordPro also work with SpeedScript: SpellRight Plus (from Professional Software) and SpellPro 64 (from Pro-Line Software).
Program 2 is a SpeedScript file conversion utility. It translates SpeedScript screen-code program files into either Commodore ASCII or true ASCII. The program works only with disk-not with tape. These translated files are stored in sequential format, the file type used in most file-processing applications. The file converter can also translate a Commodore ASCII sequential file into a screen-code SpeedScript program file. You can use the file converter to translate a database into a SpeedScript file (or vice versa), and you can convert SpeedScript files to true ASCII and use a modem program to upload them to another computer.
The SpeedScript Family
SpeedScript premiered in the January 1984 issue of the GAZETTE in the version we now refer to as SpeedScript 1.0. A slightly modified version (1.1) appeared in COMPUTE!'s Second Book of Commodore 64. The next major update, SpeedScript 2.0, appeared only on the first GAZETTE Disk, in May 1984. The original version of the currrent update, SpeedScript 3.0, was published in COMPUTE! in early 1985 (along with versions for other computers). Although version 3.0 is based on the earlier versions, it is sufficiently different that you cannot "patch" a copy of SpeedScript 2.0 (or an earlier version) to bring it up to version 3.0. You must type in the entire program.
However, if you have a copy of SpeedScript 3.0 or 3.1, you can easily upgrade to version 3.2. Simply load, but do not run, your copy of SpeedScript; then enter the following POKEs and SAVE the new version with a different name. Be very careful when typing the POKE statements. A mistyped number could introduce a bug that would be difficult to locate.
POKE 2547,96:POKE 4316,200:POKE 4946,234:POKE 4947,234:POKE 7716,50
POKE 5785,234:POKE 5786,234:POKE 5787,234:POKE 7581,11:POKE 7590,76
POKE 7591,86:POKE 7592,29:POKE 7593,201:POKE 7594,35:POKE 7595,208:POKE 7596,23
Version 3.2 doesn't add any new features or commands to versions 3.0 or 3.1; only a few minor bugs are corrected.
If you don't wish to type in the listing for SpeedScript 3.2, you may order the GAZETTE Disk for this month, which includes all the programs in this issue of COMPUTE's Gazette.May 1987 Gazette Disk