VICSTATION: A "Paperless Office"
Joel Peter Anderson
Don't neglect your VIC when you have paperwork to do. With this program, you can create, review, and edit text files - bringing you one step closer to a paperless office. Along with VICSTATION are two application programs that can use the files created by VIC's Line/Pro. Also, there are some ideas on using the VIC as a smart terminal for telecommunications.
Why did you buy your VIC? Maybe you saw it as a "smart" game machine, or perhaps as an educational tool - or you could have seen it as an inexpensive way to get into word processing. Whatever the reason, you've no doubt learned that the VIC can do quite a lot, probably more than you ever expected!
I have a friend who owns a computer with more memory than mine. He had bought a word processing program to use on his system and was describing how it worked.
"But you haven't got a printer," I pointed out, "what good is a program like that?rdquo;
He explained that it was very good indeed. Even if he had to type his final copy by hand, the word processor could be used very effectively to produce the rough draft.
That was something I had never thought of before. I wasn't planning on expanding my system for a long time, but I had a good electric typewriter - couldn't I come up with some way to have my VIC work up the rough drafts? Besides that, maybe some things could just as well be written and saved as tape files.
I came up with the program presented here - a line editor that can create, review, and edit text files - a start on a "paperless" office. Along with the editor, I've included two application programs which can use the files created by VIC's Line/Pro.
Program 1 is all you need to get started.
RUNning the program will give you a display LINE/PRO and a list of reserved words. These are very important (more about these in a minute).
To begin using the editor, hit any key. The screen will clear, and a green cursor will flash in the upper left corner. Type a line, hit RETURN, and the line will appear as blue text in the lower portion of the screen about four lines down from the top. As you continue to type, each line (up to 88 characters) will appear below the text already entered. As you will see when you have more than a screen of information, the entire text entered scrolls past after each line. If you want to quickly review what you've written, press the CTRL key to slow it down.
Two cautions: Input is through a special INPUT# statement, so if you want to include commas or colons, you have to enclose the entire line in double quotes. And obviously you can't use double quotes in your text. I usually use two apostrophes.
The reserved words are invoked by entering each word in lowercase alone, as input. If you want to have that word as part of the text all by itself, enter it as "read" (enclosed in double quotes, with an extra space following). The program will see it as five characters long and ignore it. Any line beginning with a reserve word, such as "reading is a pleasure," will not be picked up. The same trick is used to indent text - " text" indents the word "text" three spaces. The following reserve words pass control temporarily to special subroutines:
SAVE
This is used to put your current text onto tape. A corresponding routine, BYBY, is always used following one or more SAVEs. Although it is optional, when SAVEing, a file name is requested and prompts are printed for the datasette. In a series of SAVEs, the file name is only requested the first time – when opening the file. When the text is saved, control returns to the main program, but now, there is no text in memory. If you don't want to add any more to the text file, type "byby". This closes the file and ends the program.
If, on the other hand, you want to create a longer file, and there is no limit to the length of a tape file other than the length of the tape itself, then go back to entering text, editing it, and typing "save" again, as many times as you like. You very likely will wind up with a file longer than this program can handle – but more about that later.
Important note: the closing subroutine "byby" prints the character "£" as an end-of-file marker, so you can't use that in your text. If you can't live without that character, change lines 310 and 670 to use some other odd character. You'll also have to change the application programs because they expect the character "£" to end text files.
EDIT
The edit routine allows you to move line-by-line through your text – a handy way to review what you have written. You can page through a text as much as you want, and you can also change, insert, and delete anything on any line. This also uses an INPUT# statement, so the same caution as above applies. When you hit a line that needs changes, press F7 and change the line however you like as long as it doesn't become longer than 88 characters. To get quickly to something at the end of a text, page backwards past the beginning and you will be at the end of the text (sorry, this doesn't work going forward – getting to the end exits the "edit" routine).
READ
This slowly displays the entire text in memory. To pause after any line, just hit the space bar; to resume, press it again. At the end of the text, the program will wait for you to hit the space bar to return to the main program.
TAPE
"What do I do with these tape files?" you may wonder. Well, by typing in "tape" you can reenter them into the program – for review, editing, to graft them onto another file – anything you want to do as long as you don't exceed the 50-line limit. Also, you cannot use it once SAVE has been invoked.
By the way, if you ever do get kicked out of the program, type "GOTO140" to return to the main program.
BYTE
This last reserved word gives you a quick report of what line you're on and how many characters remain in memory.
FILE READER
Program 2 is what you do when your files get too long for memory. The file reader will display a tape file on the screen, and pause for any keystrokes, except for F1, which ends the program.
When the end of a file is reached, the program goes into an infinite loop which ends either:
- when you press F1 to terminate the session or
- when you press F3 to search for the next file on the tape.
DUMBTERM
Program 3 is a modification of a program that appeared in the August 1982 issue of COMPUTE!, "VIC Communications: The RS-232 Interface." What I have done is add several features to smarten up this "dumb terminal."
I noticed that several programs I used for terminals had features where special messages (passwords, i.d.'s, etc.) were often just printed directly to the RS-232 Interface without any translation. As an experiment, I tried doing that with an INPUT# statement. What I got was a simple way to have a screen editor built into your terminal. To use this, hit F3 – a red? will appear, and the cursor will turn red. As long as you don't care about upper- or lowercase, this will give you the ability to move the cursor back within the text on your screen, modify it, and then send it back over the terminal.
I have found this very handy for editing programs. The host computers I use support a line-based text editor. Often I use the editor to first delete the line I'm changing (it prints it out for verification) and then modify it and send it back using the screen editor. Be careful to enclose anything using commas or colons within double quotes.
The escape key (F1) is simply a way to exit a line being entered. The control "c" (F7) is included because the host computers I use have that as an exit character in various programs. You can change it to whatever character your local mainframes require. Simply change the CHR$(3) in line 2000 to CHR$(1) for "a" and so on.
Finally, the "tape file" command (F2) will take any tape file and send it over the terminal. Like the screen editor, this command doesn't translate; it just sends the characters over, so forget upper- and lowercase. I know from experience that this only works well when you are using some sort of text mode during which all text received is appended to a current file. Also it is necessary to instruct the host computer to go to half mode – the program prints the text file on the screen during transmission.
Half Mode
There is another reason for that last instruction. It's the reason this trick can work at all.
To quote Butterfield and Law, in the article mentioned above, "You can't use the… cassette tape while the RS-232 is in gear." You shouldn't be able to send text via the modem from the cassette. I tried it and you can't - unless you tell the host computer to stop echoing your message. If you do that, your text will go over intact with perhaps a few glitches (it pays to check it).
This feature has been very handy. When I am paying for my computer time, or doing school-work within a limited amount of computer time, I find it helps to begin writing a program on my home computer and then send it to the mainframe for editing and implementation. Also, the mainframes I use support a type of word processing. This means that a text created and edited with Line/Pro can be formatted and printed (on a printing terminal) in a nice final copy.
The effectiveness of this may vary on systems other than the CDC Cyber I am familiar with. I think, though, that you will find this a simple but effective way to use your VIC to do some powerful things.
Note: The character which appears as a backslash (\) in Programs 1-3 should be typed as the British pound symbol (£) on the VIC keyboard.