Reset Statement

Closes all files opened with the Open statement.

Syntax

Reset

Remarks

The Reset statement closes all active files that have been opened with Open, and writes all file buffers on the disk.

Example

In this example the Reset statement is used to close all open files and write their buffers on the disk. Note that the FileNumber variable of the Variant type is used as string and number at the same time.

Dim FileNumber
For FileNumber = 1 To 5     ' Repeat loop 5 times.
    ' Open file for writing. FileNumber is added 
' to the filename as string and at the same time ' serves as the loop counter. Open "TEST" & FileNumber For Output As #FileNumber Write #FileNumber, "Hello All" ' Writing data into the file. Next FileNumber Reset ' Close all files and write the contents of the buffers 'on the disk.

 

See Also

Close Statement, End Statement , Open Statement