Character Repetition; Color Selection - Radio Shack TRS-80 CGP-220 Operation Manual

Table of Contents

Advertisement

-~------------------------------------------
CHR$(44) specifies the 44th dot position within the second range. Therefore when
LINE 10 is executed, the Print Head will move the 300th dot position skipping 299
dots (or 44 dots inside the second range which begins with dot number 255, or
255+44=299).
LINE 20 is simply an LPRINT statement with no Control Codes. After the Print
Head is positioned, the phrase "THIS IS THE 300TH DOT POSITION" will be
printed.
Character Repetition
It is possible to print a character repeatedly-up
to 256 times-by using the control
code:
LPRINT CHR$(28) CHR$(n1) CHR$(n2)
where nl specifies the number ofrepetitions and n2 specifies the character to be
printed repeatedly. n2 must be a printable character; otherwise, X will be printed (see
Appendix
B
for a list of all printable characters). You may substitute the entire
CHR$ (n2) with a printable character enclosed in quotes.
This can be very useful in underlining, printing graphic codes, or repeated graphics.
Type the following single line program and run it to see how this code works.
10 LPRINT CHR$(28) CHR$(30) "T"
As you may have suspected it, the letter "T" is printed 30 times.
Color Selection
You may choose among the seven colors that the CGP-200 is capable of printing to
create attractive graphics, logos, charts, or tables. To choose a color, you must send
the code:
LPRINT CHR$(27) CHR$(84) CHR$(n1)
or
LPRINT
CHR$(27) "T" CHR$(n1)
where nl is a two-digit number from 48 to 55.
Table 4 below shows the color available with each number.
CGP-220 Color Selection
If you want to use color
Black
Red
Green
Yellow
Blue
Magenta
Violet
White (not printing)
Table4
n1 must be
48
49
50
51
52
53
54
55
19

Advertisement

Table of Contents
loading

Table of Contents