The resulting file should be sent to the printer using the COPY command, eg:
A>COPY LQ.DAT PRN
prior to printing document files. Of course, this command can also be included in a batch file.
PROGRAMMING USING BASIC
As discussed earlier, a version of BASIC is usually supplied with PC- compatible machines. With this BASIC, characters are sent to the printer using the LPRINT command, and control codes are defined using the CHR$O function.
Sample program
The following lines of BASIC give examples of how the printer may be driven from within your own programs:
1000 | ' Set control codes | 'Escapecode |
1010 | E$=CHR$(27) | |
1020 | D$=E$+"xO" | 'Draft quality |
1030 L$=E$+"xl" | 'Letterquality | |
1040 F$=E$+"k" | 'Selectfont | |
1050 C$=F$+CHR$(Z)+L$ | 'SelectCourier | |
1060 H$=CHR$(V) | 'Horizontaltab | |
1070 P$=E$+"P" | 'Pica pitch | |
1080 | ' Start printing |
|
1090 WIDTH "LPT1:",255
1100 LPRINT E$;"D";CHR$(3);CHR$(27);CHR$(O); 1110 LPRINT C$;"Font settings:"
1120 LPRINT H$;D$;"Draftcharacters,";L$;
1130 LPRINT H$;F$;CHR$(O);"TMSROMN characters," 1140 LPRINT
1210 LPRINT H$;F$;CHR$(8);"Blippocharacters,"
1220 LPRINT H$;F$;CHR$(V);"Oratorcharacters,";
1230 LPRINT H$;F$;CHR$(lO);"Helvetcharacters,"
1240 LPRINT H$;F$;CHR$(ll);"Optimocharacters,";
1250 LPRINT H$;F$;CHR$(12);"Cinemacharacters,"
1260 LPRINT H$;F$;CHR$(l3);"CODE39";
1270 LPRINT C$;" (CODE 39 characters),"
1280 LPRINT H$;F$;CHR$(14);"Greekcharacters," 1290 LPRINT H$;F$;CHR$(ZO);"SLQTMS ROMN and "; 1300 LPRINT