FileClose (Close File)

The FileClose function closes a FileHandle created by FileOpen.

Syntax

FileClose ( FileHandle )

Remarks

This function returns 0 if successful or -1 if the FileHandle referenced is not valid. FileHandle is the variable that was created by the FileOpen instruction. FileClose will return -1 if the handle specified was not opened by FileOpen or the file was already closed.

Note that this instruction does not reset the original value assigned to FileHandle.

Parameter

FileHandle (File Handle)

The program reference to the file being read from, written to, or otherwise affected by the function. A FileHandle is created by a FileOpen function and deleted by FileClose. Recommended variable type is Long.

Type: Variable