Listing On Your Printer

See all articles from The Plotter v6 n3
Author(s): William Pedersen
Publication: The Plotter
Pub Details: The Plotter v6 n3 (Volume 6, Issue 3)
Date: March 1988
Pages: 6, 8

From TIMELINEZ 2/87 by William Pederson

Can you LLIST a single program line?
Can you LLIST without interference from standard graphics?
Can you print a listing of all lines you want to relocate so you can create MERGE program sets?
Can you omit the LLISTing program itself from being LLISTed?
Does your interface do what you WANT it to do?
Can you format the LLISTing as you wish?

Why the &%@# not?

All these features represent deficiencies in commercial LLIST programs. Mostly it is caused by a lack of recognition that PRINT and LIST refer to the SCREEN but LPRINT & LLIST refer to a PRINTER. The two cannot be treated alike. The “advantage” of using tokens in print strings applies only to the 2040 printer. No other printer is compatable with TS2068 tokens, nor is there any reason for them to be. Sticking with pure ASCII, with no extensions, lets you talk with almost ALL available printers.

The program LLISTed here has none of the problems listed. It converts COMMON tokens to ASCII. It ignores color commands and number slugs which should not be printed anyway. It converts the few remaining unprintable characters to “?”. ON ERR, SOUND & RESET are treated as characters, not tokens. UDGs are not printable, they appear as “?”.

you can LLIST any number of lines, in any order, from one to the entire BASIC. You can jump around to collect them.

The program is written in relocatable format. All relative jumps and the program location depend on a single KEYWORD, (Wk). Move it anywhere you need for MERGE compatability. Just be sure to update the value of Wk in the present line 7900. You might want to change the name of Wk to something else.

Though the program is entirely in BASIC, it takes advantage of the powerful editing capabilities of the TS2068. It is incidental that you can follow the program on the screen.

If you are frugal, and hate to waste paper, set Margin=0, Wide= the maximum (80?) for your printer, and set Wq=0 in Line 7910. If you are conventional, and want your listing to look as much like the screen as possible, set Margin=15, Wide=32, and Wq=0. If you are really with it, and like your listings indented for maximum readability, try Margin=10, Wide=64, and Wq=1.

Editors Note: I tried this program with a printer IF that is selectable for ASCII or SINCLAIR BASIC. With SINCLAIR BASIC, some keywords are treated as characters and the line length overshoots to print it out.

To make this program useable you must correct the listing as follows: line 7900, 5th statement, change the bracket to “ON ERR” as a token. Line 7901, change the bracket and ? to the tokens “ON ERR RESET”. These tokens are not ASCII characters.

7900 LET wk=7900: LET margin=4:
LET Wide=32: LET w1n=2:{ GO TO w
k+19: DIM A$(margin)
7901 {?: INPUT PAPER 5;" LLIST "
; PAPER 7'"From LINE: ";wfirst;"
to ";wlast
7902 LET wa=PEEK 23635+256*PEEK
23636
7903 LET wn=256*PEEK wa+PEEK (wa
+1): LET w1=PEEK (wa+2)+256*PEEK
(wa+3): IF wn<wfirst THEN LET w
a=wa+w1+4: GO TO wk+3
7904 IF wn>wlast THEN GO TO wk+1
7
7905 CLS : PRINT TAB 4-LEN STR$
wn;wn;" ";: FOR n=wa+4 TO wa+w1+
2: LET w=PEEK (n): IF w=14 THEN
LET n=n+5: GO TO wk+9
7906 IF w>15 AND w<22 THEN LET n
=n+1: GO TO wk+9
7907 IF w>126 AND w<165 THEN LET
w=63
7908 PRINT CHR$ w;
7909 NEXT n: LET wz=800-PEEK 236
88-32*PEEK 23689: PRINT PAPER 5;
" ";wz+1;
7910 LET wq=0: GO SUB wk+15: FOR
n=0 TO wz: LET j=INT (n/32): LE
T k=n-32*j: LET L$=SCREEN$ (j,k)
: IF L$=":" AND wq>0 THEN LPRINT
CHR$ 13;: GO SUB wk+15: LPRINT
" ";: LET wc=5
7911 LPRINT L$;: LET wc=wc+1: IF
L$="""" THEN LET wq=-wq
7912 IF wc>Wide THEN LPRINT CHR$
13;: GO SUB wk+15
7913 NEXT n: LPRINT
7914 LET wa=wa+w1+4: GO TO wk+3
7915 LPRINT A$;: LET w1n=w1n+1:
LET wc=1: IF w1n>58 THEN LET w1n
=0: LPRINT CHR$ 12;: GO TO wk+15

7916 RETURN
7917 INPUT "Another section? Yes
or No: "'L$: IF LEN L$ THEN IF
L$(1)="Y" OR L$(1)="y" THEN GO T
O wk+1
7918 STOP : GO TO wk
7919 LET A$="": GO TO wk+1

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