Equinox Online Help - Language Reference - A to Z

Home

FileCloseAll

Applies to
SyntaxFileCloseAll
Action[Statement] Closes all files previously opened with the FileOpen statement within any method.
ScopeUsable anywhere
Notes

This statement saves you having to do multiple FileClose operations when you have opened several files.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

CategoryFile IO
See Also FileCloseAll, FileDelimiters, FileInput, FileInputLine, FileLock, FileMovePosition, FileOpen, FilePosition, FilePrint, FileRead, FileReadLine, FileReadBinary, FileReadFile, FileUnlock, FileWrite, FileWriteBinary, FileWriteFile
Example

The following example opens several sequential files for reading and writing, places a text string in them and closes them all.

handle hTest1, hTest2, hTest3

FileOpen "c:\test\test.dat", StreamReadOnly, hTest1

if hTest1 = -1 then
Alert "File 1 Opening Error"
Exit Method
end if
FilePrint hTest1, "Test 1"

FileOpen "c:\test\test.dat", StreamReadOnly, hTest2

If hTest2 = -1 Then
Alert "File 2 Opening Error"
Exit Method
end if

FilePrint hTest2, "Test 2"
FileOpen "c:\test\test.dat", StreamReadOnly, hTest3

if hTest3 = -1 then
Alert "File 3 Opening Error"
Exit Method
end if

FilePrint hTest3, "Test 3"
FileCloseAll