Navigation: Language Reference > 13 - Built-in Functions >====== FLUSH (flush buffers) ====== | |
FLUSH(file)
FLUSH | Terminates a STREAM operation, flushing the operating system buffers to disk, or flushes the BUFFER statement's buffers. |
file | The label of a FILE or VIEW. |
The FLUSH statement terminates a STREAM operation. It flushes the operating system buffers, which updates the directory entry for that file. FLUSH will also flush the file driver's buffers allocated by the BUFFER statement. If both STREAM and BUFFER are active, all buffers are flushed.
Support for this statement is dependent upon the file system and its specific action is described in the file driver documentation (if different from that described here).
Example:
STREAM(History) !Use DOS buffering
SET(Current) !Set to top of current file
LOOP
NEXT(Current)
IF ERRORCODE() THEN BREAK END
His:Record = Cur:Record
ADD(History)
END
FLUSH(History) !End streaming, flush buffers
OPEN(MyView)
BUFFER(MyView,10,5,2,300) !10 records per page, 5 pages behind and 2 read-ahead,
!with a 5 minute timeout
!Process records
FLUSH(MyView) !Flush buffers
See Also: