57

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) “/” CHR$(nU) in line 80.

CENTERING AND ALIGNING TEXT

Text can be arranged in any of three formats: left aligned or left-justified (normal printing with “ragged” right margin), centered between the margins, or right aligned (right-justified). These are selected by the following commands:

Table 4-11

Alignment

commands

Function

Control code

Left-justified printing

(ESC) “a” CHR$(O)

Centered printing

(ESC)

“a” CHR$(l)

Right-justified printing

(ESC)

“a” CHR$(2)

Try this program to see how easy it is.

10 ’ Demo of aligning and centering

20LPRINT CHR$(27);"1";CHR$(20);

30LPRINT CHR$(27);"Q";CHR$(60);

40LPRINT CHR$(~~);"~";CHR$(O);

50LPRINT "THIS LINE IS LEFT-ALIGNED."

60LPRINT CHR$(27);"a";CHR$(l);

70LPRINT "THIS LINE IS CENTERED."

80LPRINT CHR$(27);"a";CHR$(2);

90LPRINT "THIS LINE IS RIGHT-ALIGNED." 100 LPRINT CHRS(27);V"

110 END

When you run this program, you should get like this:

Page 63
Image 63
Star Micronics NP-IO manual When you run this program, you should get like this