77
which refers to an instruction that “calls,” or uses a group of nor-
mal instructions. In computer programming macro-instructions
(which are similar to subroutines) save programmers a lot of
time and effort. Your printer’s macro can save you a lot of time
and effort also.
Here is how the printer’s macro works. You define macro by
telling the printer what normal control codes are to be included
in the macro. Then you can use the macro any time that you
want and the printer will do all the things that you included the
macro definition. You can include up to 16 codes in a single
macro. You can even use the macro to store a frequently used
word or phrase. There are two control codes for the macro: one
to define it, and one to use it. They are given in the Table 5-9.
Table 5-9
Macro instruction commands
Function
Define macro
Use macro
Control code
(ESC)“+“...(codes you include)
. . . CHR$(30)
(ESC)“+“CHR$(l)
To see how this works we can build a macro that will reset the
printing style to normal, no matter what style it may be to start
with. The following program will define a macro to do this.
10 LPRINT CHR$(27);"+"; 'Start macro
20 LPRINT CHR$(27);"h";CHR$(O); 'Big character
off
30 LPRINT CHR$(27);"!";CHR$(O>; 'Select normal
pica
40 LPRINT ~~~$(27);"Tfl; 'Super &
subscripts off
50 LPRINT ~H~$(27);'*211; lSet l/6 inch
line spacing
60 LPRINT CHR$(27);"a";CHR$(O); 'Left-aligned
printing
70 LPRINT CHR$(30) 'End macro
definition
As the comments in the program, we started to define macro
in line 10. Line 20 cancels the big character printing. Line 30
sets the normal pica, and also this command cancels the propor-