FCLOSE

The FCLOSE function is used to close a file previously opened with FOPEN.

The length of a file that has had integer values written to it is rounded to a multiple of 8 bits when it is closed.

Syntax

FCLOSE( FILE fileHandle )

Parameters

fileHandle
The file handle to close.

Errors

A run-time error will occur if an uninitialised or already closed FILE handle is supplied.

Example

LOCAL ReadFile()()
  FILE fileHandle;

  fileHandle := FOPEN("test.bin", "r");
  IF FERROR() THEN
    PRINT("Unable to open test.bin");
    EXIT;
  END;

  // Perform file operations on the file handle...

  FCLOSE(fileHandle);
END;

See Also