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 #26 background imageLoading...
Page #26 background image
Closing a file
Closing a file ensures that the file is safely stored in the cartridge. It also
closes the channel (in this case “m”;l;“Numberr”) and leaves the stream
(in this case* 4) with no channels attached. To CLOSE a file YOU need only
CLOSE the appropriate rtream. So enter:
CLOSE # 4
The border will then flash to show that something is being stored in the
cartridge.
(Note that, like the OPEN statement, the CLOSE statement is followed
autamatically by# .I
You cannot, by the way. CLOSE streamsX0, #l. #2 or X3. If you try to do
so, streams X0 and #l will default to channel K; stream # 2 will default to
channel S; and stream #3 will default to channel P (see page 22).
Reading back from a file
To read back from the file “Numbers”, run this:
10 OPEN #4:“m”;l;“Numbers”
20.FOR b=l TO 10
30 lNPUTX4;m;n
“5; p;The Square of Tim;” , is , “a
60 CLOSE # 4
RUN
(Note at this point that because the file “Numbers” already exists, the channel
“m”;l;“Numberr” is opened for input, and trying to output it would give an
errOr.)
You can also use INKEY$ to read back from a file lit always gives the next
character in the file). Try this program:
10 OPEN # ll;“m”;l;“listing”
20 LIST *ll
30 CLOSE X11
40 OPEN X 12;“m”;l ;“listing”
50 PRINT INKEY$ HZ;
60 GO TO 50
This will finish with the End of file report.
24

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