Commodore PET User Manual page 386

Table of Contents

Advertisement

Program 4. CALLING VOU.
5 REM PROGRAM 4
CALLING YOU
10 REM
*******
B
LAN K E T
*~*****
20 REM CONT 1NUOUS-L 1NE DI SPLA'T' OF ONE
30 REM
CHARACTER ENTERED FROM THE
40 REM
KEYBOARD
50 REM
*******************************
60 GOSUB 90
70 END
90 PRINT"HIT A fŒ'T' OR <R> TO END".:
100 GET C$: 1F C$="" GOTO 100
105 IF C$=CHR$(13) GOTO 170
110 PF.: 1NT":"]" .;
: REM CLERF.: SCREEN
120 FOR 1=1 TO 920
:REM 920/40=23 LINES
130
PRItH
C$;
140
~~EXT
150 PRINT"PHEW!"
160 GOTO 90
170
RETUF~t~
Changes
Add:
Change:
Delete:
Lines 5. 60, 70
Line 170
None
Comments
The program from line 90 through line 170 can be structured as a subroutine
simply by changing line 170 from an END to a RETURN. Add a two-line main pro-
gram just ahead of the subroutine to cali it by a GOSUB 90 and then END. Note
that the subroutine maintains control until the RETURN key is struck.
373

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents