Reset Statement

Description

Closes all disk files opened using the Open statement.

Syntax

Reset

Remarks

The Reset statement syntax closes all active files opened by the Open statement and writes the contents of all file buffers to disk.

See Also

Close Statement, End Statement, Open Statement.

Example

This example uses the Reset statement to close all open files and write the contents of all file buffers to disk. Note the use of the Variant variable FileNumber as both a string and a number.


For FileNumber = 1 To 5            ' Loop 5 times.
    ' Open file for output. FileNumber is concatenated into the string 
    ' TEST for the filename, but is a number following a #.
    Open "TEST" & FileNumber For Output As #FileNumber
    Write #FileNumber, "Hello World"    ' Write data to file.FileNumber                            ' Close files and write contents 
                                ' to disk.