FEMPTY program instruction FEMPTY program instruction Syntax FEMPTY (logical_unit) Function Empty any internal buffers in use for a disk file or a graphics window by writing the buffers to the file or window if necessary. Usage Considerations When accessing a file, the file must be open for random access on the specified logical unit (see the FOPEN_ instructions). When accessing a graphics window, this instruction is useful only for a window that is opened in buffered mode.
(That is, the /BUFFERED attribute was specified in the FOPEN instruction that opened the window.) 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 During random-access I/O of a disk file, eV+ writes data to the disk in blocks of 512 bytes (characters). For efficiency, when a record with a length of less than 512 bytes is written using a WRITE instruction, that data is stored in an internal buffer and might not actually be written to the disk until a later time.
When a disk logical unit is referenced, the FEMPTY instruction directs eV+ to write its internal buffer contents immediately to the disk file. That is useful, for example, in applications where data integrity is especially critical (see FOPEN for details on defeating buffering). When a window logical unit is referenced, the FEMPTY instruction forces all buffered graphics output to be immediately written to the window. The IOSTAT real-valued function can be used to determine if any error results from an FEMPTY operation. Examples Empty the internal output buffer for logical unit 5 and write it to the disk immediately: FEMPTY (5) eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 233