## Closing an Opened File after Reading or Writing

The Insert | File I/O Command | File Close menu option allows you to insert a command in the Edit window that will close an opened file when the part program is executed. Closing files frees up resources used when files are open and commits any changes that have been made to the file to disk.

The syntax of this command in the Edit window is:

File/Close, <filepointername>,<closemode>

<filepointername> | This is the ID used to identify the file and is created when the file is opened.
<closemode> | This parameter has two options, KEEP or DELETE. Using KEEP, PC-DMIS simply closes the file defined in the file pointer. Using DELETE, PC-DMIS closes the file and then deletes it.

To access the dialog box associated with this File I / O command:

1. Open the Edit window.

2. Placing your cursor on the File Close command.

3. Press F9.

More:

Sample Code for File Close