Star Micronics NB24-10/15 Printer User Manual


 
Table 5-12
Alignment commands
Function
Control code
Left-justified printing
(ESC) “a” 0
Centered printing
(ESC) “a” 1
Right-justified printing
(ESC) “a” 2
Fully-justified printing
(ESC) “a” 3
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) ; “a0” ;
50 LPRINT “THIS LINE IS LEFT JUSTIFIED.”
6C LPRINT CHR$ (27) ; “al” ;
70 LPRINT “THIS LINE IS CENTERED.”
80 LPRINT CHR$ (27) ; “a2” ;
90 LPRINT “THIS LINE IS RIGHT JUSTIFIED.”
100 LPRINT CHR$ (27) ; “a3” ;
110 LPRINT “THIS LINE IS LEFT AND RIGHT (FULL) JUSTIFIED.”
When you run this program, you should get like this:
THIS LINE IS LEFT JUSTIFIED.
THIS LINE IS CENTERED.
THIS LINE IS RIGHT JUSTIFIED.
THIS LINE
IS LEFT AND RIGHT
(FULL)
JUSTIFIED.