FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fundamentals: WaitExample compile error (DMD1.00)

 
Post new topic   Reply to topic     Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
claestw



Joined: 05 Jan 2007
Posts: 2

PostPosted: Fri Jan 05, 2007 2:02 am    Post subject: Fundamentals: WaitExample compile error (DMD1.00) Reply with quote

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
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Fri Jan 05, 2007 2:27 pm    Post subject: Re: Fundamentals: WaitExample compile error (DMD1.00) Reply with quote

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
View user's profile Send private message AIM Address
claestw



Joined: 05 Jan 2007
Posts: 2

PostPosted: Sat Jan 06, 2007 2:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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