130 Universal Control Commands
USING BASIC TO SEND COMMANDS
Using BASIC, the control sequence to set the top margin to line 6 in DEC
emulation can be sent with the following program:
ASCII sequence: ESC [ 6 r
Control sequence in decimal: 27 91 54 114
BASIC program: LPRINT CHR$(27);"[6r";
To set the left margin to Column 6 and the right margin to Column 76 in
IBM Proprinter XL emulation, the following program could be used:
ASCII sequence: ESC X !L
Control sequence in decimal: 27 88 6 76
BASIC program: LPRINT CHR$(27);"X";CHR$(6);CHR$(76);
USING BATCH FILES TO SEND COMMANDS
If you are running DOS on your computer, you can create batch files to
send the necessary data stream to the printer. For example, to select 12-
pitch, single-strike printing in Epson emulation, the control command is
ESC ! (1). (The parentheses around "1" identify this as parameter 1,
which in the Epson emulation is decimal or hexadecimal 1—not the ASCII
character 1, which would be decimal 49 or hexadecimal 31.) In this
example, we make use of the fact that, in Epson and IBM #1 character
sets, data byte value 155 is also the ESC control code. Create a batch
file by typing the following at the DOS prompt:
COPY CON 12PITCH.BAT
ECHO ¢!^A > PRN
^Z
The first line tells the computer to copy the lines that follow into the file
named "12PITCH.BAT". The ".BAT" extension identifies the file as a
batch file.