| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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... |
|
#2
| |||
| |||
| In comp.lang.pascal.borland message <fre328$u9h$1@aioe.org>, Fri, 14 Mar 2008 15:45:28, Alan <alan@local.bin> posted: >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... Try it. In my BP7, I don't use Flush in such cases. -- (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. For news:borland.*, use their server newsgroups.borland.com ; but first read their Guidelines etc. via <URL:http://support.codegear.com/newsgroups/> ff. |
|
#3
| |||
| |||
| On 2008-03-14, Alan <alan@local.bin> 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.