Flush_Output
See Also: - File I/O Commands - Append_Output - Direct_Input - Close_Output - Get_Channel_Position - Get_Channel_Size - Open - Output - Set_Channel_Position - Write - Writeln - Seq_New_Channel - Seq_Release_Channel - Seqeof - Channel command component - Sequential File I/O
Purpose
Immediately forces a write of cached output data.
Syntax
General syntax:
Flush_Output [Channel {ChannelNumber}]
Where {ChannelNumber} may be 0 through 9, and if omitted, will be assumed to be 0 (default for input) or the last channel number explicitly specified in code executed previously.
The term Channel must be hard-coded.
What It Does
Use this command to flush output to a file when using Direct_Output or Append_Output. To improve performance, the runtime caches file output so it can write it in larger chunks. The Flush_Output command immediately forces a write of this cached data. This can be useful when writing to a log file while troubleshooting application crashes. Note that doing a flush is not necessary when closing the output, as the Close_Output command itself already does this.
Example
A simple sample of flushing output:
WriteLn " - - - Log line 1 - - - "
WriteLn " - - - Another line - - - "
Flush_Output
Example
A simple sample of flushing output using channels:
WriteLn Channel iLogChnl " - - - Log line 1 - - - "
Flush_Output Channel iLogChnl