◄Summary► ◄Details► ◄Example► ◄Back► Argument file_variable Text file, open for output Description The Flush procedure writes the contents of a text-file buffer to the file. The file must be a text file open for output. Flush has no effect on a file open for input. A buffer for a text file temporarily holds characters in memory. Flush forces the contents of the buffer to be written to the file. The Write and Writeln procedures flush the buffer automatically. It may be necessary to call Flush if Write or Writeln have been replaced by a user-defined procedure. The Close procedure flushes the buffer automatically. If the file is not open when Flush is called, an I/O error occurs. To prevent a program from halting with a run-time error when an I/O error occurs, turn off I/O checking with {$I-} and check the return value of the IOResult function.