If I May Digress; Back To The Program - AMSTRAD cpc 6128 User Instruction

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

Advertisement

Directing data to stream
#
8 sends data to the printer (if connected).
Finally, directing data to stream
#
9 sends it to the disc drive, which is what we have
done in line 3 7 0.
If I may digress ....
A few words now about the AUT 0 command which we used a moment ago. If you
leave out the line number andjust type in:
AUTO
.... the computer will commence line numbering from 10, advancing by 10 each time
[RETURN]
is pressed. If you have previously used lines 1 0, 20, 30 etc, each line's
contents will be displayed on the screen as you pass through it (by pressing
[RETURN]
each time). When each line appears on the screen, it may be edited before pressing
[RETURN],
thus providing a quick method of continuously editing regularly
successive program lines.
Back to the program ....
We've now added the instructions to save the information to disc, so the final main
section of this program will load the data back from disc, ready for use. Therefore, we
must add yet another menu option to the list of numbers in line 100. Edit line 100
again, as follows:
100 ON ms GOSUB 120,210,270,350,420
Now for the instructions to load the information. We start by
0
P E Ningthe I Nputfile
from disc called "d a t a ". Then we take IN PUT from disc (stream
#
9) of all the
values of the variables N A M E $ ( x) and T EL $ ( x) from 1 to 100, and lastly we
CL
0
SE the I Nput file and RE T URN to the menu. Type in:
420 OPENIN
"data"
430 FOR x=1 TO 100
440 INPUT #9,NAME$(x),TEL$(x)
450 NEXT
460 CLOSEIN
470 PRINT
"data Loaded"
480 RETURN
Chapter 2 Page 10
Beyond Foundations

Advertisement

Table of Contents
loading

Table of Contents

Save PDF