Retrieves the next sequential system file number available for association with a file. Use the FreeFile function to retrieve an unassociated file number from the file system. This number can be used by the Open statement to be associated with a file.
Returns an Integer reference number ready for being associated with a file.
Close | FileCopy | Kill | Name | Open
Dim intFileNum as Integer
intFileNum = FreeFile 'retrieve next free file number
Open "c:\TEST.txt" For Output As #intFileNum
Write #intFileNum, "This is a sample line of text."