Star Micronics XB24-10, XB24-15 Programming Using Basic, Sample program, Acopy Lq.Dat Prn

Models: XB24-15 XB24-10

1 140
Download 140 pages 17.48 Kb
Page 104
Image 104
A>COPY LQ.DAT PRN

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 H$;F$;CHR$(l);"TW-Lightcharacters,"; 1150 LPRINT H$;F$;CHR$(2);"Couriercharacters," 1160 LPRINT H$;F$;CHR$(3);"Prestigecharacters,"; 1170 LPRINT H$;F$;CHR$(4);"Scriptcharacters," 1180 LPRINT H$;F$;CHR$(S);"OCR-Bcharacters,"; 1190 LPRINT H$;F$;CHR$(~);"OCRTAcharacters," 1200 LPRINT H$;F$;CHR$(7);"Letter-Gothic,";

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 F$;CHR$(21);"SLQTW-Light characters"

Page 104
Image 104
Star Micronics XB24-10, XB24-15 user manual Programming Using Basic, Sample program, Acopy Lq.Dat Prn