
-----------------------------------
Beast_
Mon Jan 23, 2006 4:35 pm

Getch
-----------------------------------
Hey. I want to do one of those commands that when you say "Press any key to continue.", the user presses whatever key and it moves them up to the next step to the program. I forget how to do it, but i know getchs are involved. Help me plz  :)

-----------------------------------
Rasta Fella
Mon Jan 23, 2006 4:53 pm


-----------------------------------
You can also use this command Input.Pause It justs waits fo a user to input a key.

-----------------------------------
blaster009
Mon Jan 23, 2006 5:15 pm


-----------------------------------
But don't say "Any key".  Input.Pause doesn't accept certain keys (Control for example).  My teacher, who prides himself in looking for ways to make my programs fail (because I have a 96 in the class, I suppose) made sure to take away marks because I said "Any key" and Input.Pause failed to recognize the Page Up button.

-----------------------------------
Rasta Fella
Mon Jan 23, 2006 5:24 pm


-----------------------------------
But don't say "Any key".  Input.Pause doesn't accept certain keys (Control for example).  My teacher, who prides himself in looking for ways to make my programs fail (because I have a 96 in the class, I suppose) made sure to take away marks because I said "Any key" and Input.Pause failed to recognize the Page Up button.

Yeah, actually alot of keys dont work when you use Input.Pause(page up, page down, end, insert etc.) But that's the only command I of my knowledge know that can be used for (press any key). But in general alot of keys on the keyboard work in accordance to this. If there is another method which can make you literally "press any key to continue" I would like to know for further reference.

-----------------------------------
person
Mon Jan 23, 2006 6:26 pm


-----------------------------------
Hey. I want to do one of those commands that when you say "Press any key to continue.", the user presses whatever key and it moves them up to the next step to the program. I forget how to do it, but i know getchs are involved. Help me plz 


var a : string (1)
getch (a)


-----------------------------------
Beast_
Mon Jan 23, 2006 7:50 pm


-----------------------------------
He is right. I remember my programming teacher teaching us that stuff way back. She set it up like this:

var stop : string (1)
put "Press any key to continue."..
getch (stop)
cls


To my knowledge, that is the most efficient way of doing a user-triggered continuation of a program, if you ever want it to clear the screen, to make your program look neater. :)

-----------------------------------
Delos
Mon Jan 23, 2006 8:51 pm


-----------------------------------
Efficient, perhaps.  Stable?  No - so very simply crashed.  :lol:

-----------------------------------
Clayton
Tue Jan 24, 2006 2:03 am


-----------------------------------
how did this crash

var a:string(1)
getch(a)
cls

??????????
its never crashed for me

-----------------------------------
Delos
Tue Jan 24, 2006 10:21 am


-----------------------------------
Ah yes...well, since no one has ever mentioned this bug in Turing before, I'll keep it to myself for a while longer.  It's not important, since I only know about 2 other people who are privvy to this knowledge...
In other words, the getch() method is, for all intents and purposes, good.

-----------------------------------
person
Tue Jan 24, 2006 5:14 pm


-----------------------------------
it doesnt crash for me

-----------------------------------
Clayton
Wed Jan 25, 2006 2:56 pm


-----------------------------------
But don't say "Any key".  Input.Pause doesn't accept certain keys (Control for example).  My teacher, who prides himself in looking for ways to make my programs fail (because I have a 96 in the class, I suppose) made sure to take away marks because I said "Any key" and Input.Pause failed to recognize the Page Up button.

Yeah, actually alot of keys dont work when you use Input.Pause(page up, page down, end, insert etc.) But that's the only command I of my knowledge know that can be used for (press any key). But in general alot of keys on the keyboard work in accordance to this. If there is another method which can make you literally "press any key to continue" I would like to know for further reference.
use the hasch command, in this case it would be used in a loop

loop
exit when hasch
end loop

this way the loop will end whenever the program detects a character
(hasch means has character) you can try that
