--- title: "LKDOS Print Tools #1-5" id: 77443 type: "computer_media" slug: "lkdos-print-tools-1-5" url: "http://localhost/computer_media/lkdos-print-tools-1-5/" markdown_url: "http://localhost/computer_media/lkdos-print-tools-1-5.md" published_at: "2026-11-15T18:38:29+00:00" modified_at: "2026-11-15T18:38:29+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Five LKDOS printer and sequential-file routines: printer setup, catalogue printout, text to disk, view or print a file." post_tag: - name: "LKDOS" slug: "lkdos" taxonomy: "post_tag" url: "http://localhost/tag/lkdos/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Printer" slug: "printer" taxonomy: "genre" url: "http://localhost/type/printer/" media_type: "Program" mediadate: "1989" article_media: - id: 23405 title: "LKDOS Tools by the Half Dozen" type: "article" url: "http://localhost/article/lkdos-tools-by-the-half-dozen/" media_type_tags: "Printer" license: false --- # LKDOS Print Tools #1-5 Five LKDOS routines to MERGE into your own programs, each headed by a REM: #1 sets up the Larken printer code for an Aerco-Oliger, Tasman or A & J interface, with line width, left margin and line feed, and prints a test line; #2 prints the catalogue of one disk after another; #3 types text straight into a sequential disk file (Dta1-Dta5.A$); #4 views a disk file on the screen or LPRINTs it; #5 changes the margin and width quickly. Every routine uses RANDOMIZE USR 100 with LKDOS commands (OPEN #3,”lp”, CAT, OPEN #5 disk files, POKEs into the LKDOS RAM), so it needs the Larken disk system; there is no download. Line 9866 is an empty line number and line 9908 starts with a stray “>”, as printed. From UPDATE magazine, provided to Sinc-Link by Bill Jones; no author is named. Published in Sinc-Link July-August 1989 ([LKDOS Tools by the Half Dozen](https://timexsinclair.com/article/lkdos-tools-by-the-half-dozen/)). ## Source Code ``` 100 REM "LKDOS Print Tools #1-5" 102 BORDER 0: PAPER 0: INK 7: CLS 104 CLEAR : LET a=0: LET b=0: LET u$="" 9800 REM #1. Initialization Routine 9804 RANDOMIZE USR 100: OPEN #3,"lp": PRINT #0;"Input Type of Interface"'"<1> Aerco-Oliger"'"<2> Tasman"'"<3> A & J": PAUSE 0: LET zz=CODE INKEY$-49: IF zz>2 THEN CLS : GO TO 9804 9806 RANDOMIZE USR 100: POKE 16096,zz 9808 INPUT "Line Width?";Lw: RANDOMIZE USR 100: POKE 16090,Lw-1 9809 INPUT "Left Margin Tab?";Lm: RANDOMIZE USR 100: POKE 16094,lm 9810 INPUT "<1> for Line Feed - <2> No Lf";Lf: IF Lf<1 OR Lf>2 THEN GO TO 9810 9812 RANDOMIZE USR 100: POKE 16092,(10 AND Lf=1)+(0 AND Lf=2) 9814 PRINT #0;"Turn OFF PRINTER, Re-Set Printerswiktches, then TURN Back ON. ENTER when Done": PAUSE 0: LPRINT : CLS 9818 FOR n=1 TO 150 STEP 5: LPRINT "xxxx ";: NEXT n: LPRINT : REM Test print lines 9820 STOP 9822 REM #2. CAT PRINT * Print a Disk Catalog 9824 CLS : INPUT "Drive #";dn: RANDOMIZE USR 100: GO TO dn 9826 RANDOMIZE USR 100: POKE 16090,31: REM * Set line to 32 Chrs 9850 RANDOMIZE USR 100: OPEN #2,"lp": RANDOMIZE USR 100: CAT "",: PRINT ': RANDOMIZE USR 100: CLOSE #2 9860 PRINT AT 20,0;"Install new Diskette , -OR- ""Q"" to Quit, Any Key for Next": PAUSE 0: CLS : LET z$=INKEY$: IF z$="Q" OR z$="q" THEN GO TO 9864 9862 GO TO 9826 9864 STOP 9866 9868 REM ** Sending String Data to Disk 9869 REM #3. Create the U$ Data first * Use Caps Sym Shf to QUIT * Use ENTER for starting new line 9870 LET u$="": CLS : PRINT AT 20,0;"Turn Disk ON, Enter a file nbr <1 to 5 only)": INPUT zz: GO SUB 9970+zz: CLS : LET u$="": LET a=0: LET b=0: PRINT AT a,b;"_";: 9872 POKE 23611,220 9874 IF PEEK 23611<221 THEN GO TO 9874 9876 LET c=PEEK 23560: POKE 23611,220 9878 IF c=12 THEN GO TO 9890 9880 IF c=13 THEN GO SUB 9940: GO SUB 9902: GO TO 9872 9884 IF c=14 THEN GO SUB 9902: GO TO 9906 9885 PRINT AT 21,29;LEN u$;AT a,b;CHR$ c;: LET b=b+1: IF b=32 THEN GO SUB 9940 9886 PRINT AT a,b;"_";: LET u$=u$+CHR$ c 9888 GO TO 9872 9890 LET u$=u$( TO LEN u$-1): LET b=b-1: IF b=-1 THEN LET b=31: LET a=a-1 9892 PRINT AT a,b;"_ ";: GO TO 9872 9902 PRINT #5;u$: LET u$="": PRINT AT 21,29;" ": RETURN 9906 CLS : PRINT AT 20,0;"<1> Create More Text"'"<2> QUIT": INPUT xx: IF xx=1 THEN GO SUB 9940: GO TO 9872 9908>RANDOMIZE USR 100:CLOSE #5:STOP 9918 STOP : REM #4. LPrint or View disk file 9920 CLS : PRINT AT 20,0;"<1> View File <2> LPRINT File": INPUT xx: IF xx=1 THEN GO TO 9928 9924 CLS : PRINT AT 20,0;"Set Printer ON , Then ENTER": PAUSE 0: CLS : GO SUB 9960: REM * Send data to printer instead of screen 9928 CLS : LET u$="": GO SUB 9980+zz: REM * Open disk file for INPUT to screen or printer 9930 ON ERR GO TO 9946: INPUT #5;u$: REM * Bring in record from disk 9932 IF xx=1 THEN PRINT u$: REM * Print this record and get next record from disk. 9934 IF xx=2 THEN LPRINT u$: LET u$="" 9936 GO TO 9930 9940 LET a=a+1: LET b=0: IF a>21 THEN POKE 23692,255: LET a=21 9942 PRINT : PRINT " _";: RETURN 9946 ON ERR RESET : RANDOMIZE USR 100: CLOSE #5 9950 STOP 9952 GO TO 9920 9956 REM #5. Gosub Routine for quick format changes 9960 CLS : INPUT "Input TAB;";Lm: INPUT "Line Width";Lw: RANDOMIZE USR 100: POKE 16094,Lm: RANDOMIZE USR 100: POKE 16090,Lw-1: LPRINT : RETURN 9970 REM * Tell me how to Concatenate a number to OUT File? 9971 RANDOMIZE USR 100: OPEN #5,"Dta1.A$ OUT ": RETURN 9972 RANDOMIZE USR 100: OPEN #5,"Dta2.A$ OUT ": RETURN 9973 RANDOMIZE USR 100: OPEN #5,"Dta3.A$ OUT ": RETURN 9974 RANDOMIZE USR 100: OPEN #5,"Dta4.A$ OUT ": RETURN 9975 RANDOMIZE USR 100: OPEN #5,"Dta5.A$ OUT ": RETURN 9981 RANDOMIZE USR 100: OPEN #5,"Dta1.A$ IN ": RETURN 9982 RANDOMIZE USR 100: OPEN #5,"Dta2.A$ IN ": RETURN 9983 RANDOMIZE USR 100: OPEN #5,"Dta3.A$ IN ": RETURN 9984 RANDOMIZE USR 100: OPEN #5,"Dta4.A$ IN ": RETURN 9985 RANDOMIZE USR 100: OPEN #5,"Dta5.A$ IN ": RETURN ```