Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: Write and F...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1094 of 1118
Post > Topic >>

Re: Write and Flush

by Marco van de Voort <marcov@[EMAIL PROTECTED] > Mar 14, 2008 at 08:23 PM

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.
 




 3 Posts in Topic:
Write and Flush
Alan <alan@[EMAIL PROT  2008-03-14 15:45:28 
Re: Write and Flush
Marco van de Voort <ma  2008-03-14 20:23:44 
Re: Write and Flush
Dr J R Stockton <jrs@[  2008-03-14 19:54:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 5:42:57 CDT 2008.