digitalmars.D.learn - unformatted output
- Hasan Aljudy (12/12) Aug 31 2005 I'm reading a .d file, and for debugging purposes I need to output the
- Derek Parnell (7/22) Aug 31 2005 writefln("%s", text);
- Hasan Aljudy (3/25) Sep 01 2005 Thanks!
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/11) Sep 01 2005 Not really, there _should_ be an "unformatted" variant too...
I'm reading a .d file, and for debugging purposes I need to output the content of that file (or some of it) to the screen in certain ways. What I usually do is read the part I want to output in an array then write that array #writefln( text ); The problem is, the text itself could be something like: printf("%d stuff", stuff); in which case I would be outputting a string that contains a "%d", thus the writefln function would expect me to supply an integer, which I obviously didn't do, and I get an std.formatter error and the program aborts. Can I do unformatted output? or is there a work around?
Aug 31 2005
On Wed, 31 Aug 2005 23:41:43 -0600, Hasan Aljudy wrote:I'm reading a .d file, and for debugging purposes I need to output the content of that file (or some of it) to the screen in certain ways. What I usually do is read the part I want to output in an array then write that array #writefln( text ); The problem is, the text itself could be something like: printf("%d stuff", stuff); in which case I would be outputting a string that contains a "%d", thus the writefln function would expect me to supply an integer, which I obviously didn't do, and I get an std.formatter error and the program aborts. Can I do unformatted output? or is there a work around?writefln("%s", text); -- Derek (skype: derek.j.parnell) Melbourne, Australia 1/09/2005 4:24:38 PM
Aug 31 2005
Derek Parnell wrote:On Wed, 31 Aug 2005 23:41:43 -0600, Hasan Aljudy wrote:Thanks! lol, how simple! I must be dumb!I'm reading a .d file, and for debugging purposes I need to output the content of that file (or some of it) to the screen in certain ways. What I usually do is read the part I want to output in an array then write that array #writefln( text ); The problem is, the text itself could be something like: printf("%d stuff", stuff); in which case I would be outputting a string that contains a "%d", thus the writefln function would expect me to supply an integer, which I obviously didn't do, and I get an std.formatter error and the program aborts. Can I do unformatted output? or is there a work around?writefln("%s", text);
Sep 01 2005
Hasan Aljudy wrote:Not really, there _should_ be an "unformatted" variant too... I suggested: writeln(text); --andersThanks! lol, how simple! I must be dumb!Can I do unformatted output? or is there a work around?writefln("%s", text);
Sep 01 2005