Line Feed; Repeat Function; Color Function - Radio Shack TRS-80 CGP-220 Operation Manual

Table of Contents

Advertisement

For example, if you wanted to print the bottom dot in dot-column 144, change line 20
of the previous program to:
20 LPRINT CHR$(27);CHR$(16);CHR$C0);CHR$(144);CHR$(192)
Similarly, if you wanted to print the third dot from the top, change line 20 to:
20 LPRINT CHR$(27);CHR$C16);CHR$C0);CHR$Cl44);CHR$C132)
This is fine if you only want to print individual dots. But how do you print a
combination of dots?
It's actually quite simple too.
1.
Specify the Dot #s 0-64)
that represent each individual dot you wish to print.
2. Add those individual Dot #s together.
3. Add 128 to the sum of the Dot #s.
For example, if you want to print the first dot (Dot # 1), the fourth dot (Dot #8), and
the last dot (Dot #64), add the Dot #s together: 1
+
8
+
64
=
73. Then add 128 to
this number: 128
+
73
=
201. You would then use 201 as the addressable dot pattern
in the form CHR$(201):
10 LPRINT CHR$C18)
20 LPRINT CHR$C27);CHR$C16);CHR$C0);CHR$C144);CHR$(201)
Remember how CHR$(255) printed a solid vertical bar (all dots printed)?
If
you add
all the individual Dot #sin a column and then add 128 to that number, 255 will be
the result.
1
+
2
+
4
+
6
+
8
+
16
+
32
+
64
=
127
127
+
128
=
255
Line Feed
In the Bit Image Mode, it is assumed that you want to print rows of graphics one right
after another (each 7 dots high). A single line feed advances the paper 7 dots or
approximately 0.12 inch. This small paper advance allows for continuous printing
without unwanted space between lines.
Repeat Function
You can use the repeat code, CHR$(28), just as you do in the Text Mode.
CHR$(28) will tell the CGP-220 to print a graphic pattern a specified number of
times.
The format for the Repeat Function is:
repeat code
+
number of times to repeat
+
what to repeat
For example, LPRINT CHR$ (28); CHR$ (15): CHR$ (255) will print the solid
vertical bar 15 times.
Color Function
The color designation for the Bit Image Mode is the same as in the Text Mode. For
example, type and run the following program:
25

Advertisement

Table of Contents
loading

Table of Contents