f-w
In this program we set tabs at 10 and 20 in channel 1 in line
20. In line 30 we set tabs 15 and 25 in channel 2, and in line 40
we set tabs 17 and 28 in channel 3.
Because the channels are stored, you must make the printer to
recall one before you use it, so we used (ESC)“I”CHR$(nU) in
line 80.
CENTERING AND ALIGNING TEXT
Text can be arranged in any of three formats: left aligned (nor-
mal printing with “ragged” right margin), centered between the
margins, or right aligned. These are selected by the following
commands.
Table 4- 11
Aligning commands
Function Control code
Left-aligned printing (ESC)“a”CHR$(O)
Centered printing (ESC)“a”CHR$(l)
Right-aligned printing (ESC)“a”CHR$(2)
Try this program to see how easy it is.
10 "Demo of aligning and centering
20 LPRINT CHR$(27);"1";CHR$(20);
30 LPRINT CHR$(27);"Q";CHR$(60);
40 LPRINT CHR$(27);"a";CHR$(O);
50 LPRINT "THIS LINE IS LEFT-ALIGNED."
60 LPRINT CHR$(27);"a";CHR$(l);
70 LPRINT "THIS LINE IS CENTERED."
80 LPRINT CHR$(27>;"a";CHR$(2);
90 LPRINT "THIS LINE IS RIGHT-ALIGNED;"
When you run this program, you should get like this:
Tl-I I s L. I NE :I: t;- I.-.E:FT’-.I-Il.... I GI’.lEw:)
-r 1.4 :[ s I._ :I. I\I EZ 1 s w :I: G 1.4 -r --. 4 I....
I G 111 E 12 m