Re: undefined identifier getch()

2010-12-08 Thread Christopher Nicholson-Sauls
On 12/08/10 08:53, Stewart Gordon wrote: > On 08/12/2010 11:06, Nrgyzer wrote: >> Hey guys, >> >> I'm writing a console based tool for windows. To receive the users >> input, I >> try to use getch() but the compiler always says "Error: undefined >&

Re: undefined identifier getch()

2010-12-08 Thread Stewart Gordon
On 08/12/2010 13:25, Nrgyzer wrote: Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. kbhit just tests whether there's a keystroke waiting in th

Re: undefined identifier getch()

2010-12-08 Thread Stewart Gordon
On 08/12/2010 11:06, Nrgyzer wrote: Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successfully, but getchar() doesn&#x

Re: undefined identifier getch()

2010-12-08 Thread Nrgyzer
Great, thanks :)

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 08:57:40 -0500, Steven Schveighoffer wrote: extern(C) int kbhit(void); Um... sorry, D doesn't support void args (copy-paste problem): extern(C) int kbhit(); -Steve

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 08:25:38 -0500, Nrgyzer wrote: Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. import std.stdio; import std.c.stdlib; impo

Re: undefined identifier getch()

2010-12-08 Thread Nrgyzer
Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. import std.stdio; import std.c.stdlib; import std.c.windows.windows; void main(string[] args) {

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 06:06:18 -0500, Nrgyzer wrote: Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successful

undefined identifier getch()

2010-12-08 Thread Nrgyzer
Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successfully, but getchar() doesn't returns after a single input. Is