Epson Printer Interface Cartridge Operation Manual page 39

For the commodore 64 and the vic-20
Hide thumbs Also See for Printer Interface Cartridge:
Table of Contents

Advertisement

Repeating graphics data
The HomeWriter- has a special command for repeating a CHR$
number in simple graphics programs. To send one CHR$ number
repeatedly, the command is CHR$(8)CHR$(26) followed by the num-
ber of repetitions and then by the data number to be repeated. For
example, to send CHR$(213) forty times (as you did in the first
graphics program in this chapter) you would delete lines 30-50 from
that program and change line 20 as shown below:
20 PRINT#4,CHR$(8)CHR$(26)CHR$(40)CHR$(213)
This command is especially handy for making bar charts, as you can
see in the program and printout below.
10 OPEN4,4
20 G$=CHR$(8)+CHR$(26): B$=CHR$(255)
30
R$=CHR$(15)
40
PRINT#4,"1982 "G$CHR$(50)B$R$
50
PRINT#4,"1983 "G$CHR$(72)B$R$
60 PRINT#4,"1984 "G$CHR$(80)B$R$
70 PRINT#4,"1985 "G$CHR$(120)B$
80 CLOSE4
1982
1983
1984
1985
Using string variables
Besides the new command, the previous program introduces a pro-
gramming technique that you may want to use in graphics program-
ming. So that you do not have to type CHR$(8), CHR$(26),
CHR$(255), and CHR$(15) over and over again, you store them in
string variables. First, you put the string variables G$, B$, and R$ in
lines 20 and 30. Then you can type G$ instead of CHR$(8)CHR$(26),
B$ instead of CHR$(255), and R$ instead of CHR$(15). Notice the
plus sign that is necessary if you put more than one CHR$ number in a
string variable.
The commands used in this chapter are summarized in Appendix B.
34

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lx-90 - impact printer

Table of Contents