I h

L.

i

113

character. You can send the character with the same ASCII value. You can also access the character from a BASIC program with the CHR$ function.

In our example, we’ll assign the car a value of 60, which is the code for the character “(” in the ASCII characters. A rather ar- bitrary selection, but this printer doesn’t care!

Our chart would hardly be complete with just a picture of a car, so in Figure 7-5 we’ve made completed grids for another symbol: a telephone (quite a strange mix of characters!). The in- formation on the grids is now completed.

nDownload character definition command

You’ve read through a long explanation of download characters and we haven’t even told you the command syntax yet! Now the wait is over. This is the most complex command in your printer repertoire and now you’ve got the necessary knowledge to implement it. Here it is:

(ESC) “&,, CHR$(O) nl n2 m0 ml m2 dl d2 d3 ... dx

(except for the IBM-P mode)

(ESC) “ =” CHR$(O) nl n2 m0 ml m2 dl d2 d3 ... ak (only for the IBM-P mode)

Like the other printer’s commands, it starts with an (ESC) (CHR$(27)). The next character is an ampersand (&) (CHR$(38)) or an equal (=) (CHR$(Gl)) followed by a CHR$(O).

nl and n2 are used to specify the ASCII values of the characters you are defining. The reason that there are two bytes reserved for this is that your printer allows you to define many characters with just a single command. nl is used to specify the beginning of a range of characters to be defined; n2 specifies the end of the range. For instance, if you wanted to change the ap- pearance of the numerals from 0 to 9 (which have ASCII codes 48 through 57), the command would begin with (ESC) “&” CHR$(O) CHR$(48) CHR$(57) .. (or (ESC) “=” CHR$(O) CHR$(48) CHR$(57) ..). Of course, you can also define in- dividual characters by making nl and n2 equal.

The three bytes following the specification of the range of

Page 122
Image 122
Star Micronics NB24-10/15 user manual ESC &,, CHR$O nl n2 m0 ml m2 dl d2 d3 ... dx