Star Micronics XB24-15 Printer User Manual


 
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
1010 E$=CHR$(27)
'Escape code
1020 D$=E$+"xO"
'Draft quality
1030 L$=E$+"xl"
'Letter quality
1040 F$=E$+"k" 'Select font
1050 C$=F$+CHR$(Z)+L$
'Select Courier
1060 H$=CHR$(V)
'Horizontal tab
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$;"Draft characters,";L$;
1130 LPRINT H$;F$;CHR$(O);"TMS ROMN characters,"
1140 LPRINT H$;F$;CHR$(l);"TW-Light characters,";
1150 LPRINT H$;F$;CHR$(2);"Courier characters,"
1160 LPRINT H$;F$;CHR$(3);"Prestige characters,";
1170 LPRINT H$;F$;CHR$(4);"Script characters,"
1180 LPRINT H$;F$;CHR$(S);"OCR-B characters,";
1190 LPRINT H$;F$;CHR$(~);"OCRTA characters,"
1200 LPRINT H$;F$;CHR$(7);"Letter-Gothic,";
1210 LPRINT H$;F$;CHR$(8);"Blippo characters,"
1220 LPRINT H$;F$;CHR$(V);"Orator characters,";
1230 LPRINT H$;F$;CHR$(lO);"Helvet characters,"
1240 LPRINT H$;F$;CHR$(ll);"Optimo characters,";
1250 LPRINT H$;F$;CHR$(12);"Cinema characters,"
1260 LPRINT H$;F$;CHR$(l3);"CODE 39";
1270 LPRINT C$;"
(CODE 39 characters),"
1280 LPRINT H$;F$;CHR$(14);"Greek characters,"
1290 LPRINT H$;F$;CHR$(ZO);"SLQ TMS ROMN and ";
1300 LPRINT F$;CHR$(21);"SLQ TW-Light characters"