Opening Text Files

Before you can read or write to a file, you need to open it using the Open statement. When opening a text file for sequential access, Open has the following options:

Open file [For mode] As [#]filenumber

The mode can be Input, Output, or Append. If you specify Output and there is an existing file with the same name, it will be overwritten. You can use Append to write to the end of an existing file. The filenumber must be an integer between 1 and 511. If you are opening more than one file, you can ensure that each file has a unique file number by using the FreeFile function to return the next available file number.

0 0

Post a comment