CLOSE Statement

Purpose:

To terminate input/output to a disk file or a device.

Syntax:

CLOSE [[#]filenumber[,[#]filenumber]...]

Comments:

filenumber is the number under which the file was opened. The association between a particular file or device and file number terminates upon execution of a CLOSE statement. The file or device may then be reopened using the same or a different file number. A CLOSE statement with no file number specified closes all open files and devices.

A CLOSE statement sent to a file or device opened for sequential output writes the final buffer of output to that file or device.

The END, NEW, RESET, SYSTEM, or RUN and LOAD (without r option) statements always close all files or devices automatically. STOP does not close files.

Examples:

250 CLOSE

This closes all open devices and files.

300 CLOSE 1, #2, #3

Closes all files and devices associated with file numbers 1, 2, and 3.