--- title: "QHJ Print Formatter" type: "article" slug: "qhj-print-formatter" url: "http://localhost/article/qhj-print-formatter/" markdown_url: "http://localhost/article/qhj-print-formatter.md" published_at: "2025-11-21T19:05:17+00:00" modified_at: "2026-06-21T23:24:19+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "The last four issues of the QHJ have beed done using Quill. Quill is a decent word processor but it has problems with large files. It is sooo slow when dealing with documents over 15 pages long. I have decided to move onto another text editor. I have ED, The Editor, and MicroEmacs. Ed is…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors_r: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" issue: "5" issues_articles: - id: 61541 title: "QL Hacker’s Journal 5" type: "issue" url: "http://localhost/issue/ql-hackers-journal-4-2/" pubdate: "August 1991" archive_link: true --- # QHJ Print Formatter The last four issues of the QHJ have beed done using Quill. Quill is a decent word processor but it has problems with large files. It is sooo slow when dealing with documents over 15 pages long. I have decided to move onto another text editor. I have ED, The Editor, and MicroEmacs. Ed is too small and editor for the task and The Editor has no text formating capability. MicroEmacs has a word wrap mode that I will give me the closest thing to a word processor. One problem with using a text editor is that they do not support various print formats (bold, underline, etc). I decided to write a text formater that will read in the text file, recognize text formating commands, and sent the appropriate commmands to the printer. Below is a SSB program to do this. Commands are entered on a line by themselves and must start in the first column of the line. Commands start with a period and are two characters long. They may be upper case or lower case (no mixing cases in one command). The commands are listed below: ``` .PB - Page Break .DW - Start Double Width .DO - End Double Width .BD - Bold On .BO - Bold Off .LQ - NLQ On .LO - NLQ Off .UL - Underlining On .UO - Underlining Off ``` The program automatically prints page numbers. The commands are set to be used on a Epson FX-80 compatible printer, like the Sinclair printer. ``` ** QL Hacker's Printing Filter ** by Timothy Swenson OPEN #5,con_250x150a75x0_32 PAPER #5,4 : INK #5, 0 CLS #5 : PRINT #5,\\ BORDER #5,2,2 PRINT #5," QL Hacker's Journal Printer" PRINT #5," by Timothy Swenson"\\\ PRINT #5,"Please Have Printer Ready Then,"\\ PRINT #5,"Enter Name of File to List :" PRINT #5," (Enter Drive Name, ie. FLP1_)" INPUT #5,infile$ OPEN_IN #4,infile$ CLS #5 STRIP #5,4 AT #5,10,10: PRINT #5," P R I N T I N G " STRIP #5,2 OPEN #3,ser1 PRINT #3,CHR$(27);"x1"; page = 1 count = 1 REPeat loop INPUT #4,in$ IF EOF(#4) THEN EXIT loop IF in$=".pb" OR in$=".PB" THEN page_break : END REPEAT loop IF in$=".dw" OR in$=".DW" THEN PRINT #3, CHR$(14); : END REPEAT loop IF in$=".do" OR in$=".DO" THEN PRINT #3, CHR$(20); : END REPEAT loop IF in$=".bd" OR in$=".BD" THEN PRINT #3, CHR$(27);"E"; : END REPEAT loop IF in$=".bo" OR in$=".BO" THEN PRINT #3, CHR$(27);"F"; : END REPEAT loop IF in$=".lq" OR in$=".LQ" THEN PRINT #3, CHR$(27);"x1"; : END REPEAT loop IF in$=".lo" OR in$=".LO" THEN PRINT #3, CHR$(27);"x0"; : END REPEAT loop IF in$=".ul" OR in$=".UL" THEN PRINT #3, CHR$(27);"-";CHR$(1); : END REPEAT loop IF in$=".uo" OR in$=".UO" THEN PRINT #3, CHR$(27);"-";CHR$(0); : END REPEAT loop PRINT #3,in$ count = count + 1 IF count = 63 THEN footer END REPeat loop page_break CLOSE #3 CLOSE #4 DEFine PROCedure footer PRINT #3 PRINT #3," PAGE ";page PRINT #3,CHR$(12); page = page + 1 PRINT #3," " PRINT #3," " END DEFine footer DEFine PROCedure page_break FOR x = 1 TO (63-count) PRINT #3," " NEXT x footer END DEFine page_break ```