SpeedView
An 80-Column Preview Program For SpeedScript
Mark Schreiner
"SpeedView," an enhancement for COMPUTE!'s Commodore 64SpeedScriptword processor (versions 3.0 and higher), provides 80-column previewing of text before the actual printing. Using 4X3 high-resolution blocks, the program shows exactly how each page of the document will look when printed. A disk drive is required to create the combined file containing both SpeedScript and SpeedView.
SpeedScript, COMPUTE!'s popular word processor, becomes an even more useful resource with this program. "SpeedView" lets you preview your text file in 80 columns so you can see precisely how a printout of your document will look.
Typing It In
Program 1 is a BASIC loader which creates SpeedView. Type in and save the program; then run it. When the program asks for a filename, enter the name you wish to use for the machine language program.
To use SpeedView, load SpeedScript but do not run it yet. Next, load SpeedView with the command LOAD"SPEEDVIEW",8,1, replacing SPEEDVIEW with the name you used when creating the program (tape users should substitute ,1,1 for ,8,1 in this command). Finally, type SYS 9480 and press RETURN. This command activates SpeedScript with the SpeedView enhancement.
Two For One
If you plan to use SpeedView regularly, you have the option of creating a combined file which contains both SpeedScript and SpeedView. Like SpeedScript, the unified file loads and runs just like an ordinary BASIC program. To create this file, type in and save Program 2. Reset the computer by turning it off and on; then enter this command and press RETURN:
POKE 44,48:POKE 48*256,0:NEW
Load Program 2 back into memory and insert a disk containing copies of both SpeedScript and SpeedView. When you run Program 2, it asks you to enter the names of the SpeedScript and SpeedView files on the disk in the drive. After you've entered these filenames, you are prompted to enter a name for the new, combined file. Program 2 reads both files into memory, modifies the BASIC portion of SpeedScript, then writes the unified package back to disk using the filename you selected.
To use this combined program, load and run it as you would any BASIC program. You now have a copy of SpeedScript with SpeedView permanently installed.
SpeedView Operation
To use SpeedView, press CTRL-SHIFT-P, followed by S, the command sequence to direct SpeedScript's output to the screen. Instead of the usual jumble of scrolling lines, SpeedView presents a neatly formatted representation of the document's first page. Press RETURN to view succeeding pages. SpeedView shows exactly how each page will look when printed on paper. When the last page has been displayed, press any key to return to SpeedScript. The screen preview option is the only SpeedScript command changed by SpeedView. All others function normally.
You should never press RESTORE while previewing a document with SpeedView. If you must exit SpeedScript, press RETURN until you have reached the end of the SpeedView display and return to SpeedScript; then press RESTORE to exit. If you do not use the combined file, remember that the proper sequence is to load SpeedScript, load SpeedView, then activate SpeedView with the SYS command described above.
Some printkey values may not show up during the 80-column preview. SpeedView displays only those characters whose Commodore ASCII values are in the range of 32–90, or 193–218, inclusive. This includes the upper and lowercase alphabets, numerals, and punctuation marks. The SpeedView program code occupies 1.5K of space that's otherwise available for text memory. As a result, you may not be able to preview a very long document without breaking it into two smaller files. SpeedView behaves erratically if you change the page length to any value other than 66, or the right margin to any value greater than 80. To obtain the best results, make sure to use those settings.
For instructions on entering these listings, please refer to "COMPUTE!'s Guide to Typing In Programs" in this Issue of compute!.
Program 1: SpeedView
SB 100 OPEN 15, 8, 15 FX 110 INPUT "FILENAME FOR SPEEDVIEW FILE",-F$:IF LEN (F$)=0 THEN CLOSE 15:END DG 120 OPEN 2, 8, 2, F$+",P,W" XP 130 INPUT#15, A, A$, B, C: IF A=0 THEN PRINT "CREATING {SPACE}ML FILE":GOTO190 AG 140 IF A<>63 THEN PRINT A$:CLOSE 15:END CS 150 PRINT "FILE EXISTS. REPLACE IT? (Y/N)" FM 160 GET X$:IFX$="" THEN160 MR 170 IF X$<>"Y" AND X$ <>" Y" {SPACE}THEN CLOSE 15:END DK 180 PRINT#15,"S0:"+F$:CLOSE2:GOTO120 GD 190 READ BYT:IF BYT<>256 THEN PRINT#2, CHR$(BYT);:GOTO190 CX 200 CLOSE 2:CLOSE 15:PRINT{SPACE}"DONE" QG 210 DATA 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 162, 196 MC 220 DATA 160, 37, 142, 38, 3, 140, 39, 3, 169, 38 KQ 230 DATA 141, 169, 9, 169, 203, 141, 177, 9, 169, 0 JG 240 DATA 141, 164, 31, 162, 148, 160, 38, 142, 110, 23 EH 250 DATA 140, 111, 23, 162, 163, 160, 38, 142, 137, 24 EM 260 DATA 140, 138, 24, 169, 32, 141, 136, 24, 76, 13 RJ 270 DATA 8, 169, 0, 141, 2, 37, 141, 3, 37, 173 PF 280 DATA 4, 37, 24, 105, 3, 141, 4, 37, 238, 5 PP 290 DATA 37, 173, 5, 37, 201, 66, 208, 10, 32, 228 DX 300 DATA 255, 201, 13, 208, 249, 32, 101, 37, 76, 248 EH 310 DATA 37, 169, 23, 141, 24, 208, 169, 27, 141, 17 SG 320 DATA 208, 169, 151, 141, 0, 221, 169, 0, 141, 0 EQ 330 DATA 37, 96, 169, 148, 141, 0, 221, 169, 59, 141 EF 340 DATA 17, 208, 169, 56, 141, 24, 208, 141, 0, 37 HH 350 DATA 169, 224, 141, 166, 37, 169, 0, 141, 5, 37 AC 360 DATA 141, 165, 37, 141, 2, 37, 141, 3, 37, 141 SE 370 DATA 4, 37, 170, 138, 157, 0, 224, 232, 208, 250 PM 380 DATA 238, 166, 37, 173, 166, 37, 208, 241, 169, 16 QP 390 DATA 157, 0, 204, 157, 0, 205, 157, 0, 206, 157 EA 400 DATA 0, 207, 232, 208, 241, 96, 72, 141, 1, 37 SD 410 DATA 152, 72, 138, 72, 173, 7, 37, 240, 45, 173 FR 420 DATA 0, 37, 208, 3, 32, 122, 37, 173, 1, 37 GP 430 DATA 201, 13, 208, 3, 76, 61, 37, 201, 32, 208 GR 440 DATA 3, 76, 18, 38, 144, 12, 201, 219, 176, 8 DK 450 DATA 201, 193, 176, 18, 201, 91, 144, 14, 104, 170 DM 460 DATA 104, 168, 104, 96, 104, 170, 104, 168, 104, 76 AX 470 DATA 202, 241, 32, 38, 38, 238, 4, 37, 32, 38 QA 480 DATA 38, 206, 4, 37, 169, 4, 24, 109, 2, 37 PR 490 DATA 141, 2, 37, 173, 3, 37, 105, 0, 141, 3 JQ 500 DATA 37, 76, 248, 37, 165, 254, 72, 165, 255, 72 FD 510 DATA 173, 4, 37, 74, 74, 74, 133, 255, 160, 0 KS 520 DATA 132, 254, 74, 102, 254, 74, 102, 254, 101, 255 CD 530 DATA 133, 255, 173, 4, 37, 41, 7, 24, 101, 254 KB 540 DATA 133, 254, 165, 255, 105, 224, 133, 255, 173, 2 EX 550 DATA 37, 41, 248, 24, 101, 254, 133, 254, 165, 255 KC 560 DATA 109, 3, 37, 133, 255, 173, 2, 37, 41, 7 MS 570 DATA 170, 169, 0, 56, 106, 202, 16, 252, 141, 6 FX 580 DATA 37, 74, 13, 6, 37, 74, 13, 6, 37, 72 AB 590 DATA 160, 0, 166, 1, 169, 52, 120, 133, 1, 104 FH 600 DATA 17, 254, 145, 254, 134, 1, 88, 104, 133, 255 JD 610 DATA 104, 133, 254, 96, 72, 224, 3, 208, 5, 169 KC 620 DATA 1, 141, 7, 37, 104, 32, 186, 255, 96, 141 ED 630 DATA 29, 13, 72, 169, 0, 141, 7, 37, 32, 101 PK 640 DATA 37, 104, 96, 256
Program 2: Unified File Maker
RJ 100 IF A = 0 THEN INPUT"{CLR}NAME OF SPEEDSCRIPT";SS$:INPUT OF SPEEDVIEW";SV$ AE 120 IF A = 0 THEN A = 1:INPUT"NAME OF COMBINED FILE";NF$:PRINT"{DOWN}LOADING FILES" GQ 130 IF A = 1 THEN A = 2:LOADSS$, 8, 1 SF 140 IF A = 2 THEN A = 3:LOADSV$, 8, 1 MQ 150 A$="9480":FOR I = 0 TO 3:POKE 2054 + I, ASC(MID$(A$, 1 + 1, 1)):NEXT QS 155 PRINT"{DOWN}WRITING COMBINED FILE":OPENl, 8, 8,"0:"+NF$+",P,W" JX 165 PRINT#1, CHR$(1);CHR$(8); HS 170 FOR I = 2049 TO 9910:PRINT#1, CHR$(PEEK(I));:NEXT:CLOSE1:END