PROGRAMMING WITH BASIC
As an exampleof programmingthe printeron MicrosoftBASIC,we have listed the program for the
1000 ‘ Set control codes | ‘Escape code |
| ||||
iolo E$=CHR(27)$ |
| |||||
1020 | D$=E$+’’xO” | ‘Draft | quality |
| ||
1030 | N$=E$+”X1“ | ‘Near | letter quality |
| ||
1040 | F$=E$+”k” | ‘Select font |
| |||
1050 | C$=F$+CHR$ [0)+N$ | ‘Select Courier |
| |||
1060 | H$=CHR$ (9) | ‘Horizontal tab |
| |||
1070 | P$=E$+”P” | ‘Pica pitch |
| |||
1080 | ‘ Start printing |
|
|
|
| |
1090 | WIDTH | “LPT1:’’,255 |
|
|
|
|
1100 | LPRINT | E$;’’D’’;CHR$(3);CHR$(27);CHR$(0) ‘Set HT | ||||
1110 | LPRINT C$;”Font setting:” |
|
|
| ||
1120 | LPRINT H$;D$;”Draft characters, “;N$; |
| ||||
1130 | LPRINT H$;F$;CHR$(0) ;“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 |
|
|
|
|
|
|
1180 | LPRINT |
|
|
|
|
|
1190 | LPRINT C$;”Print pitches are:” |
| ||||
1200 | LPRINT H$;P$; ’’Picapitch | (10 CPI),”; |
| |||
1210 | LpRINT H$;E$;’’M’’Eliteitepitch | (12 CPI),U |
| |||
1220 | LPRINT H$;P$; | ‘Select condensed pitch | ||||
1230 | LPRINT CHR$(15); | |||||
1240 | LPRINT | “Condensed pica pitch | (17 CPI),”; |
| ||
1250 | LPRINT H$;E$;’’Mti;’’Condensedelite pitch | (2O CPI).” | ||||
1260 | LPRINT CHR$(18) | ‘Cancel condensed print | ||||
1270 | LPRINT H$;E$;’’P1”; | ‘Select proportional | spacing | |||
1280 | LPRINT P$;’’Proportionalspacing,”; |
| ||||
1290 | LPRINT E$;’’PO” | ‘Cancel proportional | spacing | |||
1300 | LPRINT |
|
|
|
|
|
1310 | LPRINT H5;E$;”WI”;”Expanded, “;E$:’’Wo”; |
| ||||
1320 | LPRINT H$;E$;’’wl’’Doublebheightght.“;E$;”wO” | |||||
1330 | LPRINT |
| ||||
1340 | LPRINT |
| ||||
1350 | LPRINT E$;’’h’’;CHR$(O) |
|
|
| ||
1360 | LPRINT | :LPRINT |
|
|
|
|
1370 | LPRINT E$;’’Q’’;CHR$(47)‘Set right margin |
| ||||
1380 | LPRINT C5;”Various line and character sPacin9s:” | |||||
1390 | LPRINT E$;’’al” | ‘Center text |
| |||
1400 | FOR 1=1 TO 7 |
|
|
|
| |
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 1=7 TO 1 STEP |
|
|
|
| |
1460 | LPRINT E$;’’A”;CHR$(I); |
|
|
| ||
1470 | LPRINT E$;” “;CHR$(I); |
|
|
|
1480 LPRINT “THE SPACINGS ARE CHANGED”