![](/images/new-backgrounds/1185826/185826227x1.webp)
107
In the program below, we’ve taken the logo graphics informa- tion and put it into BASIC DATA statements. The program itself is short and simple. The loop starting at line 100 reads the data statements into a string array variable called LOGO$. In line 170 we change the line spacing to 8/72 inch so that the lines of graphics data will connect vertically. The actual printing is done in the loop between lines 180 and 210; line 190 sends the graphics control code to the printer and line 200 sends one line of graphics data.
The printout from the program is shown right below the pro- gram.
10 1 Prints S&S logo
20LINE.8$=CHR$(27)+"A"+CHR$(8)
30f Set line spacing to l/6”
40LINE.l2$=CHR$(27)+"2"
1Select dot graphics
2:GRAPHIC$=CHR$(27)+CHR$(42)+CHR$(O)
70DIM LOG0$(4)
80 WIDTH "LPT1:",255
90 1 Read data
100 FOR ROW=1 TO 4
110 FOR COLUi"DJ=lTO 100
120 READ P
130LOGO$(ROW)=LOGO$(ROW)+CHR$(P)
140NEXT COLUMN
150NEXT ROW
160f Print logo
170LPRINT LINE.8$;
180FOR ROW=1 TO 4
190LPRINT GRAPHIC$;CHR$(lOO);CHR$(O);
200LPRINT LOGO$(ROW)
210NEXT ROW
220LPRINT LINE.12$
230' Row 1
240 | DATA |
| 0 | 0 | 01 |
|
|
|
| 7, | 15 |
250 | DATA | 1:; 14: 14; 14: 14; | 73: ;; | ;I | 3, | 15 | |||||
260 | DATA | 15, | 15, | o, | o, | o, | o, o, o, o, o | ||||
270 | DATA | 0, | 1, | 3, | 3, | 7, | 7, 15, 14, 14, 14 | ||||
280 | DATA | 14, | 15, | 7, | 7, | 7, | 3, | o, | o, | o, | o |
290 | DATA | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0 |
300 | DATA | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0, | 0 |
310 | DATA | 0, | 0, | 0, | 0, | 1, | 3, | 7, | 7, | 7, | 15 |
320 | DATA | 14, 14, 14, 14, 14, | 7, | 7, | 3, | 3, | 15 | ||||
330 | DATA | 15, | 15, | 0, | 0, | 0, | 0, 0, 0, 0, 0 |