1-

41

numbers is called an escape sequence.

A note on command syntax

Because the readers of this manual will be running such a wide variety of applications on so many different computers, we can’t show the exact way of sending codes to the printer for each one of them. Instead, as we introduce you to each new com- mand, we will show the commands as in this example:

(ESC) “W” 1

This command turns on expanded printing. (ESC), as we mentioned earlier, is the escape code (which is ASCII code 27). A letter or number in quotes (such as the “W” above) means that the character should be sent to the printer, but without the quotes. In our example, you should send a capital W following the escape code. In BASIC, you could do this in a couple of ways: by sending the character itself (e.g. LPRINT “W’’;),or by using the CHR$ function to send the ASCII code for the character (e.g. LPRINT CHR$(87);).

Many of printer commands end with a 1 or O.When shown as in the above example (i.e., no quotes and no “CHR$”), you can use either ASCII code 1 (i.e., CHR$(l)) or the character “l” (which is ASCII code 49). The same principle applies to com- mands ending with O.

So for our example above, any of these BASIC statements will have the same result:

LPRINTCHR$(27); “W”;CHR$(1)

LPRINTCHR$(27); “W”;CHR$(49)

LPRINTCHR$(27); “WI”

Even though there are many commands that require the use of ASCII code O(the (NUL) character), the number “O”(zero or ASCII code 48) cannot be substituted. In these cases, instead of an unadorned O we will show CHR$(0) each time these com- mands are referenced.

That’s it for the basics. You are now ready to learn how to use the many features of your printer.

Selecting the right software mode

For this printer to correctly respond to control codes, you

Page 49
Image 49
Star Micronics NX-15 user manual LPRINTCHR$27 WI