Commodore PET User Manual page 387

Table of Contents

Advertisement

Program 5, SLOW DOWN.
5 REM PROGRAM 5
SLOW DOWN
10 REM
t~*****
B LAN K E T
**~~***
20 REM CONT
l
NUOUS-L l NE DI SPLA'r' OF OhE
30 REM
CHARACTER ENTERED FROM THE
40 REM
KEYBOARD
50 REM
**~***~*~.*
••**.***.***•••**.*.
90 PRINT"HIT A KEY OR <R> TO END";
100 GET C$:IF C$="" GOTO 100
105 IF C$=CHR$(13) GOTO 170
110 PF.: l tH
"::1" .:
:
F:EM CLEAF: :::CF.:EEN
120 FOR I=1 TO 920
:REM 920/40=23 LINES
130 PF:INT C$.:
135 FOR J=1 TO 10:NEXT J
:REM DELAY
140 NEXT l
150
PRltH"PHE~J!"
160 GOTO 90
170 END
Changes
Add:
Change:
Delete:
Comments
Lines 5. 135
Line 140
None
A "do-nothing" FOR . . . NEXT loop acts as a simple delay loop. Looping
from 1 to 10 after each character print approximately doubles the processing
time. Vou can change the delay time just by changing the end index value (in this
case 10). Optionally add the index variable
1
to the NEXT in line 140. Using index
names on NEXT statements is a good idea, especially when vou have nested FOR
. . . NEXT loops.
374

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents