
-----------------------------------
tum_twish
Tue Apr 22, 2003 9:49 am

Inkey in turing
-----------------------------------
In QBasic, there is a command that will wait until a key is pressed.


DO
         'expressions
LOOP WHILE inkey$=""


or


DO
       'expressions
        SLEEP
LOOP UNTIL 'statement is true'



Is there a similar command in Turing that will wait until the key is pressed?[/code]

-----------------------------------
tomako
Tue Apr 22, 2003 9:56 am


-----------------------------------
im thinking getch, but i duno how u can wait til a "certain key"...

-----------------------------------
Blade
Tue Apr 22, 2003 10:51 am


-----------------------------------
yeah use getch, with a loop... we'll use 'h' as the certian key your waiting for
var anykey:string(1) %for getch the string has to be one character
loop
getch(anykey)
exit when anykey = "h"
put "Thats not the right key, you must press 'h'"
end loop

oh, and check out the tutorials section before you post help, it may clear up a lot of your problems
http://www.compsci.ca/bbs/viewforum.php?f=3

-----------------------------------
Homer_simpson
Tue Apr 22, 2003 11:59 am


-----------------------------------
var ch:char
loop
exit when getchar = "x"
end loop
"x" can be changed to character u want...  :)

-----------------------------------
Tony
Tue Apr 22, 2003 12:02 pm


-----------------------------------
you for got to put getch inside the loop :? And after that it would be exactly what Blade already said.

-----------------------------------
Delta
Tue Apr 22, 2003 1:45 pm


-----------------------------------
Or use hasch for anykey to be waited upon


loop
exit when hasch
end loop


-----------------------------------
Blade
Tue Apr 22, 2003 2:10 pm

Re: Inkey in turing
-----------------------------------
In QBasic, there is a command that will wait until a key is pressed.


DO
         'expressions
LOOP WHILE inkey$=""


or


DO
       'expressions
        SLEEP
LOOP UNTIL 'statement is true'



Is there a similar command in Turing that will wait until the key is pressed?

he said he wanted one so that he can wait until a key is pressed, with hasch it keeps goin past it until a key is pressed

-----------------------------------
Homer_simpson
Tue Apr 22, 2003 2:55 pm


-----------------------------------
why would u use getch command? (ch = getchar) does it all ... =/

-----------------------------------
Office of the Registar
Fri Apr 25, 2003 9:13 am


-----------------------------------
strings can be concatenated as well, maybe that's why use getch
