View previous topic :: View next topic |
Author |
Message |
claestw
Joined: 05 Jan 2007 Posts: 2
|
Posted: Fri Jan 05, 2007 2:02 am Post subject: Fundamentals: WaitExample compile error (DMD1.00) |
|
|
I get the following errors trying to compile the WaitExample on DMD 1.00:
http://dsource.org/projects/tutorials/wiki/WaitExample
Quote: | waiting.d(11): Error: undefined identifier module stream.stdin
waiting.d(11): Error: undefined identifier module stream.stdin
waiting.d(11): Error: no property 'getch' for type 'void'
waiting.d(11): Error: function expected before (), not 1 of type int
|
and the line 11 in question is:
Code: | std.stream.stdin.getch(); |
Commenting out this line compiles and works.
Oh, also a question on this tutorial. If I use writefln instead of writef, the messages only appears after I press a key, why is that so? Kind of counter-intuitive here. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Fri Jan 05, 2007 2:27 pm Post subject: Re: Fundamentals: WaitExample compile error (DMD1.00) |
|
|
claestw wrote: | I get the following errors trying to compile the WaitExample on DMD 1.00:
http://dsource.org/projects/tutorials/wiki/WaitExample
Quote: | waiting.d(11): Error: undefined identifier module stream.stdin
waiting.d(11): Error: undefined identifier module stream.stdin
waiting.d(11): Error: no property 'getch' for type 'void'
waiting.d(11): Error: function expected before (), not 1 of type int
|
and the line 11 in question is:
Code: | std.stream.stdin.getch(); |
Commenting out this line compiles and works. | I guess that method doesn't work anymore. I removed that part of the example.
claestw wrote: | Oh, also a question on this tutorial. If I use writefln instead of writef, the messages only appears after I press a key, why is that so? Kind of counter-intuitive here. | I don't know why that would be. I think that sometimes the output from writef is "cached" (and hidden) until the console is sent a command that the line should be printed. I agree that the message should appear before the key is pressed.
Are you having a problem with the example as it's written (using only writefln) or with a modified version using writef? I'd rather keep problematic code out of the examples -- especially if a better equivalent method is available. |
|
Back to top |
|
|
claestw
Joined: 05 Jan 2007 Posts: 2
|
Posted: Sat Jan 06, 2007 2:10 am Post subject: |
|
|
The text display problem only happens with writef, not as the example was written. Also, I'm using Windows XP so it could be a Windows quirk.
I see my original post mixed up the two. No problems with writefln, problem only happens with writef.
Interesting, though, that if I use writef and then call system("pause"), the screen will show the system pause message, and after the user presses a key, then show the writef message. I hope it's not actually something in writef itself. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|