
-----------------------------------
appling
Sat Nov 22, 2003 4:12 pm

getch &amp; hasch
-----------------------------------
i am worried about my homework. i don't know getch & hasch clearly.So is there anyone can help me??
how to use getch & hasch.

-----------------------------------
Tony
Sat Nov 22, 2003 4:31 pm


-----------------------------------
getch grabs a single character from the input buffer.

var c:string(1)
getch(c)
put c


hasch returns true if there's anything in input buffer waiting to be processed. It is generally used to skip getch so that program continues even without user's input.


var c:string(1)

loop
if hasch then
    getch(c)
    locate(1,1)
    put "you've pressed ",c
    delay(1000)
end if
locate(1,1)
put "waiting..."
end loop


-----------------------------------
Mazer
Sat Nov 22, 2003 4:33 pm


-----------------------------------
use getch to get a character. like this:

var character : string (1) %