TASWORD and the Larken Printer Driver

See all articles from Sinc-Link v6 n6
Author(s): George Chambers
Publication: Sinc-Link
Pub Details: Sinc-Link v6 n6 (Volume 6, Issue 6)
Date: November/December 1988
Pages: 13

A lot of my Timex club work involves writing letters in duplicate. That is to say, I make a carbon copy. As a consequence, most of the time I use single sheets of paper, rather than formfeed. With a lengthy letter this gets quite involved. What I required was a modification to Tasword to enable it to PAUSE after printing out a page, so that I could insert the next page in the printer.

When Larry K’s new version 3 EPROM DOS came out with it’s improved printer driver routine it seemed an appropriate time to rework the Tasword print routine.

The results of this exercise are shown in the following listing.

Several things should be noted in this listing:

1. There are a number of variables in the listing which are undeclared. They are variables with the names oo, oa, ob, oc, od, etc. The idea is to create a set of easily identifiable variables names.

Bill Jones, editor of the Timex periodical, TS UPDATE, must be given credit for this idea. Bill’s standard is to make oo=0, oa=1, ob=2, oc=3, od=4, etc., continuing up to ot=20. Of course, for a particular program you may not need every one of the. Use only those that you need. But stay with the philosophy, and at any time it is easy to determine what a variable represents, by counting it out alphabetically.

I have used this system of variables throughout Tasword to save space, so I declared the variables very early in the program. You may do likewise, or simply declare them in a new line 202.

2. This listing gives a number of options, such as Drive selection, page pause, lines per page, starting line #, line spacing, etc. Default values are given, so that if they are acceptable you may simply press the ENTER key. I entered “buried” colour codes for each of the INPUT queries, to make them stand out. These do not appear in the listing, but you might consider their use.

3. Line 203 sets up the Larken Printer driver. Poke 16090 establishes page length (64 characters, Poke 16092 establishes whether there is to be a line feed along with the carriage return (no, in the case of my printer, yours might be different)

You may note that the LINE 203 that invokes the Larken printer driver has been treated as a REM line. This is because I later realized that to use the Tasword “graphics” printer codes I would have to stay with the Tasword printer driver code!!

The Page Pause routine operates on this basis. When the feature is invoked at line 205, lines 230 and 265 mark out the data that is to be printed on the initial sheet. Printing is then carried out by lines 275, 280, and 285. The program then jumps to line 287 to print a “next page” message, and to introduce a PAUSE until a key is pressed.

When a key is pressed line 287 continues, through to line 289 to mark the next block of data that is to be printed; jumps to line 275 for a repeat of the printing routine; and so on until the last of the text that is to be printed is reached. Lines 266 & 288 check for the end of the file and make any necessary correction so that the printer stops promptly after the last line of text has been printed. That is to say, so that it does not sweep over empty lines to the end of the marked out page.

Modified TASWORD (Partial listing)

 200 CLS : PRINT AT VAL "14",VAL "10";"PRINT OPTIONS": PRINT "  just press ENTER for default  values given in brackets"
201 DIM d$(32)
203 REM For Larken Printer Driver: REM PRINT #od: OPEN #oc,"lp": PRINT #od: POKE VAL "16090",VAL "65": PRINT #od: POKE VAL "16092",oo
205 LET h=oo: LET p=oa: POKE VAL "23658",oo: INPUT " Page Pause? N/(Y)";a$: IF a$="n" THEN LET p=oo: LET h=a: GO TO VAL "220"
212 INPUT " Lines per page?(55)";b$: IF b$="" THEN LET b$="55": LET g=VAL "3520": GO TO VAL "220"
215 LET g=VAL b$*VAL "64"
220 POKE VAL "60927",oa: REM left margin
222 INPUT " Line spacing? (1)";a$: IF a$="" THEN LET a$="1"
223 POKE VAL "62235",VAL a$
225 INPUT " Start at line? (1)";a$: IF a$="" THEN LET a$="1"
230 LET c=VAL "64"*(INT VAL a$-VAL "1"): LET b=c+FN p(VAL "62216"): LET x=VAL "60045": GO SUB VAL "950"
240 INPUT " Finish at line? (last) ";a$: IF a$="" THEN LET b=a-c: GO TO VAL "250"
245 LET b=VAL "64"*INT VAL a$-c
250 RANDOMIZE USR VAL "59806": RANDOMIZE USR (FN p(VAL "62472"))
260 CLS : PRINT AT VAL "20",oo;"Press the q key to quit printing"
265 IF p THEN LET b=VAL b$*VAL "64": LET g=b: LET h=b
266 IF g>a THEN LET b=a: LET g=b: LET h=b
270 LET x=VAL "60049": GO SUB VAL "950"
275 LET c=PEEK VAL "62470": IF c<>oo THEN LPRINT CHR$ c
280 RANDOMIZE USR VAL "60038"
282 IF h>=a THEN GO TO VAL "290"
285 LET c=PEEK VAL "62471": IF c<>oo THEN LPRINT CHR$ c
286 IF PEEK VAL "23560"=VAL "113" THEN GO TO 290
287 IF p AND h<a THEN PRINT AT VAL "15",oa;"Press a key for next page"'" Lines left "; PAPER of;(a-h)/VAL "64"; PAPER og: PAUSE oo: LET b=FN p(VAL "60045"): LET b=b+VAL b$*VAL "64": LET x=VAL "60045": GO SUB VAL "950": LET h=h+g
288 IF h>=a THEN LET b=a-(h-g): LET x=VAL "60049": GO SUB VAL "950"
289 PRINT AT VAL "15",oa;d$;d$: GO TO VAL "275"
290 RANDOMIZE USR VAL "59806": GO TO VAL "10"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.