home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,633 of 2,978   
   Marco van de Voort to Alan   
   Re: Write and Flush   
   14 Mar 08 20:23:44   
   
   From: marcov@stack.nl   
      
   On 2008-03-14, Alan  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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca