Close
Closes the specified file
Close [#<File No.>[,#<File No.>]...]
Parameters
<File No.>
|
The file number (integer) of the file to be closed.
|
Return Value
None.
Description
This closes a file that has been opened for data I/O processing.
In <File No.>, specify the <File No.> that was specified when the file was opened using the Open command.
A file closed using the Close command cannot be used for I/O processing until it is opened again using the Open command.
The <File No.> specified in Close can be specified with a later Open command for I/O processing of other files.In addition, files that have been freed from the <File No.> specified by Close can be opened again using the same <File No.>.
Multiple files can be closed at one time with a single Close command by specifying multiple File Numbers.
Omitting the <File No.> will result in all open files being closed.
When a file that has been opened for output is closed, closing is done only after all of the data remaining in the file buffer has been written out.Always execute the Close command in order to ensure the correct end of a file writing operation.
Example
Open a file and then Close it after writing data to it.
Open "C:\input.dat" for output as #1
Print #1 DATA&
Close #1