For some unknown reason I have been having difficulty in sending other than simple printer codes from my Oliger IF to my Epson QL-570 printer by using LPRINT. The Oliger system is a bit touchy on this. In reviewing the Oliger file I found the following program from John that addresses this subject.
This program uses OUT 127,n thus addressing the IF port 127. John’s explanation is that I must be sure the printer is ready to accept a control code, and then send it directly out PORT 127. Bill Jones wrote on this subject in UPDATE one time. However John thought he wasn’t completely correct. I have used the OUT 127,n in direct mode to set up the printer but LPRINT seems to be handier. Anyway, INKEY$ #3 will return the letter “R” if the printer is ready to receive, or the letter “B” if busy. In this day of large printer memory I am not sure that this interrogation is necessary.
The second program uses 2 POKEs to eliminate LET /P=O. Actually, these pokes enter different code in the MC so if LET /P=O is used after the pokes their input is changed. This apparently has made it possible to use the LPRINT command.
1 GO TO 10
5 IF INKEY$#3="B" THEN GO TO 5
6 OUT 127,x: RETURN
8 REM lines 5 and 6 send code in variable x to the printer
10 PRINT
20 LET x=27: GO SUB 5: LET x=CODE "K": GO SUB 5
21 LET x=8: GO SUB 5: LET x=0: GO SUB 5
30 FOR I=1 TO 8: READ x: GO SUB 5: NEXT I
40 DATA 255,129,129,129,129,129,129,255
50 REM this prints a square of 8 columns and 8 lines in pixels
100 POKE 23300,60: POKE 23301,3
105 REM graphic code for Epson QL-570, 50 column line
110 LPRINT CHR$ 27;CHR$ 42;CHR$ 0;CHR$ 50;CHR$ 0;
120 FOR x=1 TO 50
125 REM print 4 parallel lines 50 columns long
100 POKE 23300,60: POKE 23301,3
105 REM graphic code for Epson QL-570, 50 column line
110 LPRINT CHR$ 27;CHR$ 42;CHR$ 0;CHR$ 50;CHR$ 0;
120 FOR x=1 TO 50
125 REM print 4 parallel lines 50 columns long
130 LPRINT CHR$ 85;
140 NEXT x
150 LPRINT CHR$ 10;