Changing Direction - Epson FX-80 User Manual

Hide thumbs Also See for FX-80:
Table of Contents

Advertisement

NEW
4~
LPRINT
CHR$(27)"K"CHR$(7)CHR$(~);
45
I
Model I users see Appendix I
8~
FOR
X=~
TO 6
11~
LPRINT CHR$(2
A
X);
12~
NEXT X
.......
When X equals 0, 2
A
X is I-so the bottom graphics pin is fired. When
X equals 1, 2
A
X is 2-so the second pin is fired. This pattern con-
tinues right up through X equals 6, which fires the seventh pin. We
purposely omit X equals
7
to accommodate systems that are limited to
seven bits.
Changing direction
The next step is to change the direction of the slash. Can you guess
how it's done? Sure, just reverse the order of the exponents, and the
same routine can be used. In fact, we'll tum it into a subroutine:
1~ F=~
4~
LPRINT
CHR$(27)"K"CHR$(14)CHR$(~);
I
Change 7 to
14
5~
GOSUB
8~:
F=1: GOSUB
8~
7~
LPRINT CHR$(27)"@": STOP
8~
FOR
X=~
TO 6
I
No change
9~
N=X: IF F=1 THEN N=6-x
11~
LPRINT CHR$(2
A
N);
I
Change X to N
12~
NEXT X: RETURN
I
Add RETURN
,
..
"
The routine is initially called with N equal to X, so the exponents
increase in order from 0 to 6. The second time the routine is called, N
is equal to 6 minus X, which reverses the order (from 6 down to 0). F is
used as a flag to activate the change of direction in subroutine 80. Line
90 selects the correct value for the exponent N.
This two-directional slash routine can be repeated indefinitely. For
an interesting variation, we can alternate the direction of the slashes
each time a pair is printed by changing the flag F in line SO. Make this
change:
138

Advertisement

Table of Contents
loading

Table of Contents