Example:
if (userRequest == "C") try close fileA; onException myErrorHandler(12); end end
The behavior of a close statement depends on the type of I/O object that is associated with the resource being closed.
When you use the name of an indexed, serial, or relative record in a close statement, EGL closes the file associated with that record.
If a file is open and you use the fileAssociation item to change the resource name associated with that file, EGL closes the file automatically before executing the next statement that affects the file. For details, see resourceAssociation.
EGL also closes any file that is open when the program ends.
When you use the name of a MQ record in a close statement, EGL ensures that the MQSeries® command MQCLOSE is executed for the message queue associated with that record.
If the I/O object is a print form, the close statement issues a form feed and either disconnects from the printer or (if the print form is spooled to a file) closes the file.
Before you use ConverseVar.printerAssociation to change the print destination, close the printer or file specified by the current value of ConverseVar.printerAssociation. Issue a close statement option for each print destination, as multiple printer or print files can be open at the same time.
The EGL runtime ensures that all printers are closed when the program ends.
When you use the name of an SQL record in a close statement, EGL closes the SQL cursor that is open for that record.
EGL automatically closes a cursor in these cases:
Related concepts
Record types and properties
resultSetID
Segmentation in text applications
SQL support
Related tasks
Syntax diagram for EGL statements and commands