AMSTRAD cpc 6128 User Instruction page 112

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

36 PRINT "5. Load info"
37 INPUT "enter menu seLection";ms
38 ON ms GOSUB 40,90,130
39 GOTO 32
40 FOR x=1 TO 100
45 CLS
47 PRINT "press [RETURN] to end input"
50 INPUT;" name";NAME$(x)
55 IF NAME$(x)="" THEN 80
60 INPUT" phone";TEL$(x)
70 NEXT
80 PRINT "no more input"
85 RETURN
90 FOR x=1 TO 100
95 IF NAME$(x)="" THEN 120
100 PRINT NAME$(x);" ";TEL$(x)
110 NEXT
120 PRINT "List finished"
125 RETURN
130 INPUT "find";SEARCH$
140 FOR x=1 TO 100
150 IF INSTR(NAME$(x),SEARCH$)=0 THEN 180
160 PRINT NAME$(x);" ";TEL$(x)
170 RETURN
180 NEXT
190 PRINT "name not found"
200 RETURN
You'll see that in certain parts of the program, we're starting to run out of lines to
insert instructions, so let's create some more space and tidy things up by
RE NU Mberingthelines. Type in:
RENUM
LI
ST
You should now see:
10 REM teLephone book
20 DIM NAME$(100)
30 DIM TEL$(100)
40 PRINT "1. enter i nfo"
50 PRINT "2. List info"
60 PRINT "3. search"
70 PRINT "4. save info"
80 PRINT "5. Load info"
90 INPUT "enter menu seLection";ms
Beyond Foundations
Chapter 2 Page 7

Advertisement

Table of Contents
loading

Table of Contents