
-----------------------------------
silvershadow
Sat Jun 03, 2006 7:43 am

Using a char without pressing enter
-----------------------------------
im building a simple game, but im tired of having to type in words and pressing enter to do anything. i was hoping, to just press one single keyboard button, to make something take place. 


var choice : char

get choice

if choice = 'u' then
    guess := 1
    put "You bet under 7"
end if


that is not my full code, that is just a sample of it, which i shortened to help better understand my problem.

when the user has to enter their choice..they press a character, but then they have to press Enter after it in order for it to work. is it possible to edit my code so that way they wont have to press Enter? i just want the user to press the charactor and it automatically works.

thanks.

-----------------------------------
TheOneTrueGod
Sat Jun 03, 2006 8:03 am


-----------------------------------

var ch : char %Also works with strings
ch := getchar
put ch


-----------------------------------
silvershadow
Sat Jun 03, 2006 8:42 am


-----------------------------------
thanks alot, really appreciate it.  :)

-----------------------------------
TheOneTrueGod
Sat Jun 03, 2006 9:28 am


-----------------------------------
No problem, thats what the help forum is here for  :D
