The command in line 180 begins the definition process. It ends with two ASCII numbers that set up the range of characters to be defined. Since this program defines only one character, the two numbers are the same (both 60). If, however, you want to define more than one character, you put the number of the first one in the first position and the last one in the second position. For example, to redefine all the capital letters the command would be as follows because 65 is the ASCII code for capital A and 90 is the code for capital Z.

LPRINT CHR$(27)"&"CHR$(0)CHR$(65)CHR$(90);

The CHR$(0) tells the printer which RAM area to use, but since an unmodified printer has only one area, always use CHR$(0) there.

The above method works for the standard printable characters (codes 33 to 126 and 161 to 254). If you need to redefine more charac- ters, you can use ESCape codes to allow you to define and print certain control codes in the same way that you treat other characters.

The ESCape “6” command changes codes 128 through 159 and 255 to printable characters, and ESCape “7” returns these codes to their normal functions. In the same manner, ESCape “I1” changes the following codes into printable characters: O-6,16-17,21-26,28-31, 128- 134, 144-145,149-154,156-159.ESCape “I0” returns these codes to their normal functions.

Data numbers for user-defined characters

Each user-defined character requires 12 data numbers. The first one should be 128 if the character uses the top eight pins and 0 if it uses the bottom eight pins. The other 11 numbers specify the dot patterns, using the same pin numbering system that is used for printing dot graphics. As you may have noticed, the program on page 108 always uses zero for the last two numbers (line 220).

WIDTH statements

Defining many characters may use so much data that your computer system interferes with your character definition by inserting carriage return and line feed codes. To avoid this problem use a WIDTH statement, such as the one below, in any program that defines more than two or three characters:

WIDTH "LPT1:",255

The format for this statement may be different for your system. Consult your software manuals.

C-9