digitalmars.D - Suggestion for writef/writefln (or can this be already done now?)
- Id <Id_member pathlink.com> Aug 28 2004
- Andy Friesen <andy ikagames.com> Aug 28 2004
- Nick <Nick_member pathlink.com> Aug 28 2004
- "Walter" <newshound digitalmars.com> Aug 28 2004
- Nick <Nick_member pathlink.com> Aug 28 2004
Some commandline programs write, per example, percentage of completion in the screen. Those programs usually write a line, and update the numbers by overwriting over the same line continuously. Is this possible with writef/writefln or another function already made in Phobos?
Aug 28 2004
Id wrote:Some commandline programs write, per example, percentage of completion in the screen. Those programs usually write a line, and update the numbers by overwriting over the same line continuously. Is this possible with writef/writefln or another function already made in Phobos?
You can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though. -- andy
Aug 28 2004
In article <cgqcmd$31fg$1 digitaldaemon.com>, Andy Friesen says...You can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though.
Works exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless you write out a newline somewhere, your writefs won't do anything at all. You can get around this by using stdout.writeString from std.string instead. Nick
Aug 28 2004
"Nick" <Nick_member pathlink.com> wrote in message news:cgqde2$4q$1 digitaldaemon.com...In article <cgqcmd$31fg$1 digitaldaemon.com>, Andy Friesen says...You can achieve this by writing a \r (instead of \n) at the end of line. I don't know if this works the same way in Linux, though.
Works exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless you
a newline somewhere, your writefs won't do anything at all. You can get
this by using stdout.writeString from std.string instead.
or calling std.c.stdio.fflush(stdout) should work.
Aug 28 2004
In article <cgqio8$20p$3 digitaldaemon.com>, Walter says...Works exactly the same in Linux. A problem is the writef-doesn't-flush thing, thing though. Unless you write out a newline somewhere, your writefs won't do anything at all. You can get around this by using stdout.writeString from std.string instead.
or calling std.c.stdio.fflush(stdout) should work.
Yes, but that's so... C-ish :-P Nick
Aug 28 2004








Nick <Nick_member pathlink.com>