CLOSE

Format

CLOSE number1

Description

This function closes the file number identified by number1. If an error is returned by DOS, the system variable "ERROR" will be > 0.

Example

CLOSE 1
IF ERROR > 0 THEN CHECKERROR:
After successful execution of the CLOSE statement, the file previously opened as file 1 will be closed. If an error is returned by DOS, the ERROR variable will be set by ASIC to a non-zero value.

Comments

If you fail to close an open file (which was opened for writing), you may lose data, since file i/o is buffered, and the last buffer may not have been flushed.

Also, number1 may only be a constant with the value of 1-3.

See Also

  • OPEN
  • PRINT#
  • INPUT#