Terminates imput/output operations with the file, opened with the Open statement.
Close [filenumberlist] |
Optional argument filenumberlist can contain one or more file numbers. It's syntax looks the as shown below (filenumber is any allowable file number):
[[#]filenumber] [, [#]filenumber] . . .
If the filenumberlist argument is omitted, all active files opened with the Open statement are closed.
When closing a file opened in the Output or Append modes, the contents of the last ouptut buffer is added into the file. All buffers, associated with the closed file are cleared.
The Close statement breaks relationship between the filename and associated file number.
Here the Close statement is used to close three files that have been opened in the Output mode.
Dim I, FileName For I = 1 To 3 ' The loop repeats 3 times. FileName = "TEST" & I 'Create the filename. Open FileName For Output As #I 'Open the file. Print #I, "Example." ' Write a string into the file. Next I Close ' Close all 3 open files. |
See Also |
Recording Data in a File, End Statement , Open Statement, Reset Statement, Stop Statement |