Thread overview
getch ()
Jan 09, 2002
Karl Bochert
Jan 09, 2002
Walter
Jan 09, 2002
Pavel Minayev
January 09, 2002
Two questions:
1) When I try to hold a dos box open with 'getch ();' I get the error
    message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do not match argument types ()'
   I must be doing something stupid?.

2)) Is there any reason D can't have a getch() that does what it says, as opposed to
'get_first_char_of_line()' ?   It can be done, and part of the rationale for D is to
correct C's flaws.

Karl Bochert


January 09, 2002
Actually, D doesn't have a getch(). It just calls the C one directly. Are
you passing an argument to getch()?

"Karl Bochert" <kbochert@ix.netcom.com> wrote in message news:1103_1010544653@bose...
> Two questions:
> 1) When I try to hold a dos box open with 'getch ();' I get the error
>     message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do
not match argument types ()'
>    I must be doing something stupid?.
>
> 2)) Is there any reason D can't have a getch() that does what it says, as
opposed to
> 'get_first_char_of_line()' ?   It can be done, and part of the rationale
for D is to
> correct C's flaws.
>
> Karl Bochert
>
>


January 09, 2002
"Karl Bochert" <kbochert@ix.netcom.com> wrote in message news:1103_1010544653@bose...
> Two questions:
> 1) When I try to hold a dos box open with 'getch ();' I get the error
>     message 'E"\dmd\src\phobos\stdio.d(142) getch function parameters do
not match argument types ()'
>    I must be doing something stupid?.

Open stdio.d. Do a searh-n-replace: "(void)" => "()". Now it should work.

> 2)) Is there any reason D can't have a getch() that does what it says, as
opposed to
> 'get_first_char_of_line()' ?   It can be done, and part of the rationale
for D is to
> correct C's flaws.

getch() is not a D function, but a C one. It's just one another advantage of D that it links to C libraries and borrows quite a lot of functions from there, giving us a common set to work with. The native D library is just not fully implemented yet.