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