December 06, 2013 Re: stdout - autoflushing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benji | Benji wrote: > Hello, > in order to have correctly displayed output (before reading > something from stdin), > I must call stdout.flush(). > Sometimes, it's really annoying, especially when it is necessarry > to call it 10 times. > > For example: > write("Enter some string: "); > stdout.flush(); > string a = readln(); > write("And again please: "); > stdout.flush(); > string b = readln(); > ... > > Is there any way to prevent this? I doubt. Your IDE is buffering application's streams. -- Dejan Lekic dejan.lekic (a) gmail.com http://dejan.lekic.org |
December 06, 2013 Re: stdout - autoflushing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dejan Lekic | On Friday, 6 December 2013 at 20:39:22 UTC, Dejan Lekic wrote:
> Benji wrote:
>> Is there any way to prevent this?
>
> I doubt. Your IDE is buffering application's streams.
You know though, this happens often enough that maybe we should just throw in a stdout.flush to the global readln function. I wouldn't put it on File.readln since that's likely wrong anyway, but on the global one it is probably what people want/expect anyway.
|
Copyright © 1999-2021 by the D Language Foundation