--- title: "Prt_dir1" id: 77480 type: "computer_media" slug: "prt_dir1" url: "http://localhost/computer_media/prt_dir1/" markdown_url: "http://localhost/computer_media/prt_dir1.md" published_at: "2026-11-15T18:38:17+00:00" modified_at: "2026-11-15T18:38:17+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Howard Clase's structured SuperBASIC version of Pri_dir: prints QL disk directories on a SER1 printer." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Howard Clase" slug: "howard-clase" taxonomy: "indiv" url: "http://localhost/indiv/howard-clase/" genre: - name: "Printer" slug: "printer" taxonomy: "genre" url: "http://localhost/type/printer/" media_type: "Diskette" programmers: - name: "Howard Clase" slug: "howard-clase" taxonomy: "indiv" url: "http://localhost/indiv/howard-clase/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Prt_dir1%20%281991%29%28Clase%2C%20Howard%29%28Sinclair%20QL%29%28CA%29%28Program%29.zip" mediadate: "1991" article_media: - id: 23360 title: "Putting the SUPER into BASIC" type: "article" url: "http://localhost/article/putting-the-super-into-basic/" - id: 23304 title: "SuperBasic Tutorial Part 2: Printing in Columns" type: "article" url: "http://localhost/article/superbasic-tutorial-part-2-printing-in-columns/" - id: 23624 title: "SuperBasic Tutorial: Part 3 (or maybe 4)" type: "article" url: "http://localhost/article/superbasic-tutorial-part-3-or-maybe-4/" media_type_tags: "Printer" license: false --- # Prt_dir1 Prints the directory of the disk in FLP1_ on a printer connected to SER1, then asks More?; press Y for another directory (change the disk first), any other key to finish, which sends a form feed and closes the printer channel. It is Butch Weinberg’s seven-line Pri_dir rewritten in structured SuperBASIC as Set_up, Main and Finish PROCedures, the starting point of Howard Clase’s series Putting the SUPER into BASIC. The article also lists two FuNctions to add: Get_Dev$, which offers the default device and lets you type another, and True_dev, which accepts only names such as flp1_ or mdv2_. The article says to put the Get_Dev$ call in line 210, but it belongs in line 220 (the DIR line), as the author corrected in the next episode. The download is the complete Ver 0.1 program; the listing below also has the added lines as printed. Signed (c)1990 H.J.Clase. Published in Sinc-Link January-February 1991 ([Putting the SUPER into BASIC](https://timexsinclair.com/article/putting-the-super-into-basic/)). ## Source Code ``` Prt_dir1 Ver 0.1 (the program in the download) 100 nm$ = "Prt_dir1" 110 REMark hjc 1990.11.03 Ver 0.1 120 Set_up: Main: Finish: STOP 130 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 140 DEFine PROCedure Set_up 150 OPEN#3,ser1 160 dev$="flp1_" 170 END DEFine 180 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 190 DEFine PROCedure Main 200 LOCal lp 210 REPeat lp 220 DIR#3,dev$ 230 PRINT#0,"More?" 240 IF NOT INKEY$(-1)=="y":EXIT lp 250 PRINT#3 260 END REPeat lp 270 END DEFine 280 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 290 DEFine PROCedure Finish 300 PRINT#3,CHR$(12): CLOSE#3 310 END DEFine Change to line 210 (belongs in line 220) 210 DIR#3,Get_Dev$(dev$) Get_Dev$ and True_dev, added at the end 320 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 330 DEFine FuNction Get_Dev$(df$) 340 LOCal dv$,k$,j$,lp 350 CLS: PRINT"Directory of ";df$;" ?" 360 PRINT "Enter, or type new name." 370 REPeat lp 380 k$=INKEY$(-1) 390 IF k$=CHR$(10) 400 dv$=df$ 410 ELSE 420 PRINT k$;: INPUT j$: dv$=k$&j$ 430 END IF 440 IF True_dev(dv$): EXIT lp 450 BEEP 3000,25: REMark bad name! 460 END REPeat lp 470 RETurn dv$: END DEFine 500 REMark ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 510 DEFine FuNction True_dev(d$) 520 LOCal l%,n$,p$,ok%: ok%=0 530 p$="mdv/flp/fdk/ram/hdk" 535 n$="12345678" 540 l%=LEN(d$) 550 IF l%=4: d$=d$&"_": l%=5 560 IF l%=5 570 IF d$(1 TO 3)INSTR(p$) 580 IF d$(4)INSTR n$ AND d$(5)="_" 590 ok%=1 600 END IF: END IF: END IF 610 RETurn ok%: END DEFine ```