Chapter
10
I
BASIC
Keywords
Statement
CLOSE
[buffer,
...I
Closes access
to
a
disk file.
Buffer
is the number assigned
to
the file when you opened it. If
you omit
buffer,
BASIC closes all open files.
This command terminates access to a file through the specified
buffer. If
buffer
has not been assigned by an OPEN statement,
then CLOSE
buffer
has no effect.
Do not remove a disk that contains an open file. Close the file
first,
because the last records may not have been written yet.
Closing the file writes the data currently in the buffer if it has
not been written already.
Note that CLEAR, END, NEW, RESET, and SYSTEM automat-
ically close all files when executed.
See also OPEN and Chapter
7,
“Disk Files.”
Examples
CLOSE
1,
2,
8
terminates the file assignments
to
Buffers
1,
2,
and
8.
You can
now assign these buffers
to
other files with OPEN statements.
CLOSE
FIRST%
+
COUNT%
terminates the file assignment
to
the buffer specified by the sum
FIRST%
+
COUNT%.
119