OPEN


    OPEN filename FOR mode AS #handle
Open a file for reading, writing, or appending. This syntax is deprecated, and the function FOpen() is preferred.
The file modes are:

    Input        Read from the file
    Output    Write to the file, destroying prior contents
    Append    Write to a file, leaving prior contents
The handle is a filenumber. You can find the next available handle by calling FreeFile().
Close a file by calling Close # or Fclose(). You can close all open files with Close.


    ' Copy "source.txt" to "copy.txt"
    OPEN "source.txt" FOR INPUT AS #1
    OPEN "copy.txt" FOR OUTPUT AS #1

    ' Read the first file, and copy to the second
    WHILE NOT EOF( 1 )
        LINE INPUT #1, text
        PRINT #2, text
    WEND

    ' Close the files
    CLOSE #1
    CLOSE #2