omron — FCLOSE program instruction

FCLOSE program instruction FCLOSE program instruction Syntax FCLOSE (logical_unit) Function Close the disk file, graphics window, or graphics icon currently open on the specified logical unit. Usage Considerations No error is generated if a file or graphics window is not open on the logical unit, although the IOSTAT real-valued function returns an error code. When a graphics window is closed, the window is not deleted from graphics memory and its stacking and display status are not changed. Parameter logical_unit Real value, variable, or expression (interpreted as an integer) that identifies the device to be accessed.

(See the ATTACH instruction for a description of logical unit numbers.) Details After a program has finished accessing a file that has been opened via an FOPEN instruction, the program must close the file by executing an FCLOSE instruction. FCLOSE frees the file for access by the eV+ monitor and other programs. In addition, for files that have been opened for writing, FCLOSE writes out any data still buffered by eV+ and updates the file directory information. Thus, if this operation is not performed, the disk file may not actually contain all of the information written to it.

If a program is finished accessing a graphics window, or needs to reuse its logical unit number, the window can be closed with this instruction. After a window is closed, it can be deleted with an FDELETE instruction or it can be opened again later with an FOPEN instruction. NOTE: Reopening a window resets all its text and graphics attributes (for example, color, font ID, character path and orientation, texture, logical operation, and enabled events), which must be explicitly reset by the program before attempting output to the window.

An FCLOSE operation is automatically performed on a logical unit when the unit is detached, when the program that issued the FOPEN completes execution, or when a KILL of the program task is performed. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 217