On 2008-03-14, Alan <alan@[EMAIL PROTECTED]
> wrote:
> I am wondering whether or not a call to the Flush() procedure is
> required after a call to Write(Output) (assuming Output is tied to the
> screen)?
>
> Example:
>
> begin
> Write(Output, 'Enter a string: ');
> Flush(Output); { do we need this here? }
> ReadLn(Input, s);
> end.
>
> In languages like C, this is the standard practice, but I can't find
> any mention about needing to do this in Pascal. I'm assuming we do
> because Output is still a text file...
There is no difference between the languages here. The flush should be
there, but because it is probably empty for the screen in TP, omitting
doesn't happen to hurt.
But the TP textfile definition does include a flush function, and textfile
types are pluggable (by e.g. assigncrt), so an alternative implementation
that sends it to a LCD over a one wire connection might require it.


|