PROGRAMMING WITH BASIC

As an example of programming the printer on Microsoft BASIC, we have

listed the program for the IBM-PC. This program runs in the printer’s

Standard mode, and the downloadable condition (EDS switch A-l ON and

A-2 OFF).

1000 ' Set control codes
1010 E$=CHR$(27) 'Escape code
1020 D$=E$+"xO" 'Draft quality
1030 N$=E$+"xl" ‘Near letter quality
1040 P$=E$+"k" 'Select font
1050 C$=P$+CHR$fb)+N$ 'Select Courier
1060 H$=CHR$(9) 'Horizontal tab
1070 P$=E$+"P" 'Pica pitch
1080 I Start printing
1090 WIDTH "LPT1:",255
1100 LPRINT E$;"D":CHR$(3);CHR$(27);C~$(O) 'Set HT
1110 LPRINT C$;"Pont setting:"
1120 LPRINT H$;D$;"Draft characters, ";N$:
1130 LPRINT H$;F$;CHR$(O);"Courier characters,"
1140 LPRINT H$;F$;CHR$(l);"Sanserif characters.";
1150 LPRINT H$;F$;CHR$(4);"Script characters."
1160 LPRINT H$;F$;CHR$(7);"Orator characters."
1170
1160 LPRINT
1190 LPRINT C$;"Print pitches are:"
1200 LPRINT H$;P$;"Pica pitch (10 CPI).";
1210 LPRINT H$;E$;"M";"Elite pitch (12 CPI)."
1220 LPRINT H$;P$;
1230 LPRINT CHRS(15); 'Select condensed pitch
1240 LPRINT "Condensed pica pitch (17 CPI).";
1250 LPRINT H$;E$;"M";"Condensed elite pitch (20 CPI),":
1260 LPRINT CHR$(lS) 'Cancel condensed print
1270 LPRINT H$;E$;"pl": 'Select proportional spacing
1280 LPRINT P$;"Proportional spacing,";
1290 LPRINT E$;"pO" 'Cancel proportional spacing
1300 LPRINT
1310 LPRINT H$;E$;"Wl";"Expanded, ":E$;"WO";
1320 LPRINT H$;E$;"wl";"Double-height. ";E$."wO"
1330 LPRINT H$;E$;"h";CHR$(l);"Double-sized:"
1340 LPRINT H$;E$;"h";CHR$(2);"Quad-sized.";
1350 LPRINT E$;"h";CHR$(O)
1360 LPRINT :LPRINT
1370 LPRINT E$;"Q";CHR$(47) 'Set right margin
1380 LPRINT C$;"Various line and character spacings:"
1390 LPRINT E$."al"
1400 FOR I=1 Tb 7 'Center text
1410 LPRINT E$;"A";CHR$(I); 'Set line spacing
1420 LPRINT E$;" ";CHR$(I); 'Increase character space
1430 LPRINT "THE SPACINGS ARE CHANGED"
1440 NEXT I
1450 FOR I=7 TO 1 STEP -1
1460 LPRINT E$;"A";CHR$(I);
1470 LPRINT E$;" ";CHR$(I):
1480 LPRINT "THE SPACINGS ARE CHANGED"
101