Equinox Online Help - Language Reference - A to Z

Home

FileClose

Applies to
SyntaxFileClose HandleItem
Action[Statement] Closes a file previously opened with the FileOpen statement. This can be used to close both random and sequential files.
ScopeUsable anywhere.
Notes

The HandleItem parameter must be an Equinox variable type Handle and is the handle of the file which was opened with the FileOpen statement.

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, FileWrite, FileWriteBinary, FileWriteFile
Example

The following example opens a sequential file for reading and writing, places a text string in it and closes it.

handle hnd

FileOpen "c:\test\test.dat", StreamCreate, hnd

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

FilePrint hnd, "Hello World"
FileClose hnd