EasyManuals Logo

Sinclair ZX INTERFACE 1 User Manual

Sinclair ZX INTERFACE 1
64 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #30 background imageLoading...
Page #30 background image
Extending a file
Suppose that you want to extend the file “Numbers” to include the squarer
of the numbers 1 to 20 instead of only 1 to 10. You cannot
reopen a
file for
writing, so you will have to:
-
make a new version with a different name;
-
transfer the old file to the new version;
-
add the extra data;
- delete the old file.
Here is how to do it.
First, RUN this program:
10 OPEN #4;“m”;l;“Numbers”: REM for reading
2Q OPEN # 5;“m”;l;“Numbers 1”: REM for writing
30 FOR f=l TO l@
40 INPUT # 4;m;n
50PRlNTX5;m’n
60 NEXT f
74 FOR n=ll TO 20
80 PRINT X 5;n’nX-n
90 NEXT n
100 CLOSE X4:CLOSE Y 5
Now, to check that you have got two files, “Numbers”and “Numbers 1”.
enter:
CAT 1
Next, to delete the old file, enter:
ERASE “m”~l~“Numbers”
I I
To check that it has been deleted, enter:
CAT 1
The file name “Numbers” will have disappeared from the catalogue, and
your new file, “Numbers 1” now contains the numbers from 1 to 20.

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX INTERFACE 1 and is the answer not in the manual?

Sinclair ZX INTERFACE 1 Specifications

General IconGeneral
BrandSinclair
ModelZX INTERFACE 1
CategoryComputer Hardware
LanguageEnglish