LLIST Program

Developer(s): William J. Pedersen
Date: 1987
Type: Program
Platform(s): TS 2068
Tags: Printer

LLISTs any lines of a BASIC program to a full-size printer as plain ASCII. Keywords come out as their text, colour codes and the hidden five-byte numbers are left out, and characters no ordinary printer has (graphics, UDGs) print as ?. It can list a single line, a range, or several ranges one after another, and leave itself out of the listing.

MERGE it with your program and GO TO 7900. Give the first and last line numbers of a range; each line is shown on the screen and printed; answer Y to Another section? for more. Set margin, Wide (characters per line) in line 7900 and wq in line 7910 to suit the printer (the article suggests margin 0 or 15 with Wide 32, or margin 10, Wide 64 and wq=1 for statements indented after each colon). The program only depends on wk in line 7900, so it can be moved to other line numbers. It prints a form feed every 58 lines.

Written by William Pederson (as printed) and first published in TIMELINEZ, February 1987. Lines 7900 and 7901 are corrected as the article’s editor’s note says: the bracket and ? printed there are the TS2068 tokens ON ERR and ON ERR RESET, which this program itself prints as { and ?.

Published in The Plotter March 1988 (Listing On Your Printer).

Image Gallery

Source Code

7900 LET wk=7900: LET margin=4: LET Wide=32: LET w1n=2:ON ERR GO TO wk+19: DIM A$(margin)
7901 ON ERR RESET : 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 wa=wa+w1+4: GO TO wk+3
7904 IF wn>wlast THEN GO TO wk+17
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 23688-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): LET 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 TO 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.