RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.Flush Function

Empties the buffer of a text file opened for output.

Pascal
function Flush(var t: Text): Integer;
C++
int Flush(Text t);

System

F is a text file variable. 

When a text file is opened for output using Rewrite or Append, Flush empties the file's buffer. This guarantees that all characters written to the file at that time have actually been written to the external file. Flush has no effect on files opened for input. 

Flush returns 0 if the operation succeeded. Otherwise, it returns the error code. When compiled using the {$I-} flag, the IOResult method returns this value.

Note: {$I+} handles runtime errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!