Repeating A Pattern; Repeating Data Numbers - Epson FX-80 User Manual

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

Advertisement

2!i' A$=CHR$(27)+"K"+CHR$(14)+CHR$(!i')
3!i' LPRINT A$;
4!i' FOR X=l TO 14
6!i' LPRINT CHR$(N);
7!i' NEXT X
Perfect! Just like the plan.
Repeating a pattern
Now how would you go about
repe~ting
this same pattern-add
more data? Here you don't need to. For simple programs like this one,
a RESTORE statement works quite well. Change two lines:
3!i' FOR Y=l TO 1!i': RESTORE: LPRINT.
A$j.
7!i' NEXT X: NEXT Y
The new loop in line 30 repeats the pattern 10 times. But you don't
need 10 repetitions of the DATA statements. The RESTORE statement
in line 30 tells the program to read the same data again. Used with
restraint, the RESTORE statement can reduce the amount of data
needed.
Repeating DATA numbers
Sometimes it is necessary to repeat the same DATA number several
times in succession. Try this change:
9!i' DATA 8,28,62,93,28,28,28,28,28,28,93,62,28,8
This program fires the middle three pins (CHR$(28)) 6 times in succes-
sion. But can you imagine typing the data for 20 or 50 repetitions of
the same number? There has to be a better way-and there is.
152

Advertisement

Table of Contents
loading

Table of Contents