EasyManua.ls Logo

Commodore PET - Page 391

Commodore PET
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Program 9, PRINTOVER Il.
LINES
:REM
TO
:REM
PAUSE
5
REM
PRO
GRAM
9
PRINTOVER
II
10
REM
*******
B
LAN
K E T
*******
20
RE
1'1
COt-n
l
NUOUS-L
l
NE
DI
SPLA'T'
OF
ONE
30
REM
CHARACTER
ENTERED
FROM
THE
40
REM
KEYBOARD
50
REM
***************~**~~~**~~
........
**
E:5
0$="
86
R$=" "+Q$
'REM
40
BLANKS
87
S$=R$+O$
:REM
BLANKS
FOR
2
LA8T
LINES
90
F'RINT"HIT A
tŒ',-'
OR
-CR>
TO
Et·m".:
1(10
GET
C$:
IF
C$=""
GOTO
100
105
IF
C$=CHR$(13)
GOTO
170
107
IF
F-C>0
THEN
GOSUB
600
:REM
TO
BLANK
2
110
PR
l
NT"
l:lI" ; :
REM
HOt'lE
CURSOR
120
FOR
1=1
TO
919
REM
919/40=23
LINES
1:30
PRINT
C$.:
135
PRIt-lT
"~".:
cs;
"!!II".; :
REM
PF~INT
REV
140
NEXT
141 PRIt-lT cs;
142
GOSUB
610
:REM
TO
BLANK
2 LINES
150
PRINT"PHEW!"
155
FOR
1=1
TO
1000:NEXT
157
F=l
160
GOTO
90
170
END
6(10
PR
II'4T"
jlIJ'
[Q[Q[Q[Q[Q[Qrml[Q[Q[Q[Q~"
;
610
PRINT
S$;
":T1II".;
62(1
RETURN
" :
RE,..l
39
BLANKS
NEXT-TO-LAST
LI
NE
Changes
Add:
Change:
Delete:
Lines
5.
85-87. 107, 135. 141-142. 155, 157.
600-620
Lines 110, 120
None
Comments
The extensive changes made here illustrate the lengths vou have
to
go
to
in
order
to
smooth the rough edges of a simple program modification. (Recall
that
in
PRINTOVER
1 vou had
to
change
just
one character of the program
to
get the
tvpeover effectll
To
show
movement at the
printing
of
each character. the character
is
printed (Iine 130) and then in the next position the reverse
of
the character
is
printed (Iine 135).
At
line 135 the cursor
is
also backed up one
so
that
the next
loop iteration
will
print
the character in the same position where the reverse
character was
just
printed. The end loop index
in
line 120
is
changed from 920
to
919
so
that
the reverse character.
which
runs one ahead of
C$.
will
not
print
bevond the 920th position. Line
141
has
to
be
added
to
print
C$
at this last
character displav position.
378

Table of Contents

Related product manuals