Apple ImageWriter II User Manual

Page 29

Advertising
background image

Using Control Characters and Escape Sequences

You can change various settings on the ImageWriter II by sending the printer either a control character or
an escape sequence. Essentially, both of these send instructions to the printer; for example, change to
bold type, issue a form feed, and return to normal type, are all instructions to the printer. A control
character is just a single character, whereas an escape sequence always begins with an escape character
and is followed by one or more characters.

With members of the Apple II family, you can communicate these instructions to the printer by pressing
certain keys (after a PR#1 or as a setup string) or by writing commands into a program. For example,
typing CONTROL-L as a setup string sends a single character instruction telling the printer to perform a
form feed.

Note:Beyond their command menus, the Macintosh Plus, Macintosh, Macintosh XL, and the Lisa Office
System can command the printer through programs, but not through typing a direct command.

If you wanted to write a program to send a form feed instruction to the printer, you would write a line using
the control character’s ASCII code. (The form feed character’s ASCII code is 12.) For example, an
Applesoft program might have the line

/v/40 PRINT CHR$(12)

bASCII Codes

ASCII stands for the American Standard Code for Information Interchange. This code is a standard
character set used by many computers and peripheral devices to process and communicate data.
Appendix B has a complete list of all ASCII codes.

You can also type escape sequence characters directly to the printer (in an application program or after a
PR#1 instruction). For example, to have the ImageWriter II print in boldface type, you would press

Escape !

In a program, you would need to supply the ASCII codes for ESCAPE (27) and for ! (33). As an
alternative, you could enclose the exclamation point in double quotation marks—“!”. Thus, your program
line would look like this

/v/50 PRINT CHR$(27); CHR$(33)

or this

/v/50 PRINT CHR$(27); ”!”

Commonly Used Printer Instructions

This section gives the most commonly used control codes and escape sequences. For other codes, see
the reference card at the back of this manual and the ImageWriter II Technical Reference Manual. A
sample configuration program follows these instructions.

By the Way: If you have an application program that you need to configure for printing, pay close
attention to the following codes. Configuration programs often prompt you for information such as the
code for boldface type, for underlining, and so on.

Advertising