Table 16-1.ASCII pattern

PatternExample

Roman letter = L

G

=

72

lowercase letter = L + 32

g = 72 + 32 = 110

Italic letter = L + 128

G

=

72 + 128 = 200

Italic lowercase letter = L + 160 g = 72 + 160 = 232

With this in mind, add these lines:

40 READ L: PRINT CHR$(L) 'Print to screen

50 FOR Y=0 TO 1: FOR Z=0 TO 1: A=L+128*Y+32*Z

and make these changes:

60 LPRINT CHR$(27)"&"CHR$(0)CHR$(A)CHR$(A); 70 LPRINT CHR$(139);

90 NEXT Z: NEXT Y

Line 50 calculates the code (A), to be defined in line 60, by adding the appropriate amount to the base letter L. Line 60 is the CHR$(27)“&” defining sequence, and line 70 sets the attribute byte to 139.

The code for the letter to be defined and the data for its four components are stored in DATA statements. Delete lines 200-210 and type:

250 ’G

 

 

 

 

260

DATA

71

 

 

 

270 DATA
0,15,16,0,32,31,64,0,64,0,64

 

280

DATA

64,4,72,2,32,2,24,4,0,0,0

 

290

DATA

0,120,4,0,2,124,1,0,10,1

 

 

300

DATA

1,64,0,124,2,68,8,120,0,64,0

 

Here’s the printing routine:

 

 

100

A$="":

INPUT "ENTER A STRING

", A$:

 

 

IF A$="" THEN 180

 

 

110

INPUT

"ENTER A MASTER PRINT MODE

NUMBER

",M

120

LPRINT CHR$(27)"!"CHR$(M);

 

 

130

FOR Y=0 TO 1: FOR X=1 TO LEN(A$)

 

140A=ASC(MID$(A$,X,1))+128*Y

150LPRINT CHR$(A)CHR$(A+32);

160NEXT X: LPRINT: NEXT Y

170LPRINT

Some BASIC systems do not support the MID$ statement-instead they use subscripts to isolate portions of a string. To designate the

219