CLOSE
FUNCTION
This command terminates access to a file or printer, unlocks the file if necessary, and enables you to erase the file.
SYNTAX
CLOSE link-name [ERASE]
CLOSE PRINTER printer-link-name
CLOSE ALL- link-name
- the link where the data file is specified.
- printer-link-name
- the name of a printer link specified in Dictionary-IV.
NOTES
-
CLOSE automatically unlocks the file if necessary.
-
Terminating the script closes all links and devices opened by the script, except for overlay (type 3) scripts.
-
Use CLOSE to save memory space when opening numerous files and devices.
-
The ERASE option is primarily intended for use with work files. ERASE causes the data file, sort file, and text file open in the link to be erased. The data file, sort file, and text file are specified in the link, but you can override these files by using the OPEN command DATA-FILE IS. SORT-FILE IS, and TEXT-FILE IS options.
Note: The ERASE option erases the entire physical file, even if the data file is a multi-format file.
-
If the data file being erased is in use by another task, then the file will not be erased. To ensure that the file will be erased, a LOCK can be performed before the ERASE.
EXAMPLES
CLOSE 4STEMP ERASE
CLOSE PRINTER 4GLPSEE ALSO
LOCK, OPEN, TERMINATE, UNLOCK
From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF