Classic Computer Magazine Archive COMPUTE! ISSUE 73 / JUNE 1986 / PAGE 101

ProDOS File Converter
For Apple SpeedScript


Leh-Wen Yau

This program speeds up conversions between ASCII text files and files compatible with the SpeedScript 3.0 word processor, which was published in the June 1985 issue of COMPUTE! and is also available in book form (SpeedScript: The Word Processor for Apple Personal Computers, COMPUTE! Books). The new converter program works on all Apple He and IIc computers with ProDOS.


Apple SpeedScript 3.0 (COMPUTE!, June 1985) is such a powerful word processor that many people, including myself, rely on it heavily for their word processing needs. I use the ProDOS version because it handles larger documents than the DOS 3.3 version. Written entirely in machine language, SpeedScript is efficient and fast.
    However, the same cannot be said for the "SpeedScript File Converter" program, which lets you convert ASCII text files into SpeedScript files and vice versa. It's written in Applesoft BASIC and takes quite a few minutes to convert documents of any substantial size. Fortunately, it's not difficult to speed up the SpeedScript File Converter with the help of a short machine language routine. The modified File Converter completes its job within seconds, no matter how large a document is.
    To see for yourself, type in and save Program 1 at the end of this article. When you run this program, it writes the machine language routine to disk under the filename SS.CONVERT. (Because Program 1 creates a file named SS.CONVERT, you must not use this name for Program 1 itself when you save it to disk.) You don't need to run Program 1 every time you want to use File Converter, just once to write the SS.CONVERT routine for File Converter to use. Then type in Program 2, the complete new version of the File Converter.
    If you already have the old File Converter on disk, you can save some typing by modifying it rather than entering Program 2. Just follow these steps:

1. Type in and save Program 1, then run it to create the disk file named SS.CONVERT.
2. Delete lines 150 through 180 from the old File Converter.
3. Delete lines 240 through 260 from the old File Converter.
4. Add the following three lines to the Converter:

1 PRINT CHR$(4); "BLOAD
  SS.CONVERT"
150 CALL 768,8192,L-1,1
240 CALL 768,8192,L-1,0

5. Save the modified Converter on the same disk as the SS.CONVERT file.

    When you run the modified Converter, it BLOADs the machine language routine from disk. It works just the same as the old File Converter in all other respects.


For Instructions on entering these listings,
please refer to "COMPUTE!'s Guide to Typing
In Programs" in this issue of COMPUTE!.

Program 1: Speed-Up
Routine Generator For
File Converter


BA 10 FOR I = 768 TO I + 145: RE
      AD A: POKE I,A: NEXT
94 20 PRINT CHR$ (4);"BSAVE SS.C
      ONVERT,A$300,L$92"
EE 30 END
31 100 DATA 32,183,0,201,44,208,
       3,32,190,222,32
FB 110 DATA 103,221,32,82,231,16
       5,80,133,250,165,81
3F 120 DATA 133,251,32,190,222,3
       2,103,221,32,82,231
IF 130 DATA 165,80,133,252,165,8
       1,133,253,32,190,222
0A 140 DATA 32,248,230,224,1,208
       ,46,160,0,165,251
01 150 DATA 197,253,208,6,165,25
       0,197,252,240,31,177
09 160 DATA 250,201,60,208,6,169
       ,13,145,250,208,4
D3 170 DATA 41,127,145,250,24,16
       5,250,105,1,133,250
20 180 DATA 165,251,105,0,133,25
       1,208,213,96,224,0
D6 190 DATA 208,251,160,0,165,25
       1,197,253,208,6,165
60 200 DATA 250,197,252,240,237,
       177,250,201,13,208,6
D8 210 DATA 169,60,145,250,208,4
       ,9,128,145,250,24
7B 220 DATA 165,250,105,1,133,25
       0,165,251,105,0,133
A4 230 DATA 251,208,213


Program 2: SpeedScrlpt File
Converter For ProDOS


E7 1 PRINT CHRS(4);"BLOAD SS. CON
     VERT
4A 10 HOME
52 20 D$ = CHR$ (4)
25 40 PRINT "DO YOU WANT TO:"
A6 50 PRINT " (1) MAKE A SPEEDSC
      RIPT FILE INTO A TEXT
      FILE"
AE 60 PRINT " (2) MAKE A TEXT FI
      LE INTO A SPEEDSCRIPT
      FILE"
67 70 SET A$:A = VAL (A$)
47 80 IF A < > 1 AND A < > 2 THE
      N 70
65 90 ON A GOTO 100,200
53 100 PRINT "ENTER SPEEDSCRIPT
       FILE NAME": INPUT ":";A$
89 110 PRINT "ENTER TEXT FILE NA
       ME TO CREATE": INPUT ":";
       B$
7E 120 PRINT D$;"BLOAD ";A$;",A$
       2000"
A4 125 L = PEEK (48859) + PEEK
       48860) * 256 + 8192
28 150 CALL 768,8192,L - 1,1
C9 190 PRINT D$;"CREATE ";B$;",T
       TXT"
F5 195 PRINT D$;"BSAVE ";B$;",A$
       2000,E";L - 1;",TTXT"
B3 196 END
6D 200 PRINT "ENTER TEXT FILE NA
       ME": INPUT ":";B$
06 210 INPUT "ENTER SPEEDSCRIPT
       FILE NAME TO CREATE   :";
       A$
25 220 PRINT CHR$ (4);"BLOAD ";B
       $;",A$2000,TTXT"
93 230 L = PEEK (48859) + PEEK (
       48860) * 256 + 8192
17 240 CALL 768,8192,L - 1,0
1A 245 IF PEEK (I) = 141 THEN PO
       KE I,60
4A 295 PRINT D$;"BSAVE ";A$;",AB
       192,E";L - 1
B4 296 END