
-----------------------------------
air_force91
Fri Jan 09, 2004 5:40 pm

press any key
-----------------------------------
now...if i want my title page to include "press any key to continue..." for a key to be pressed and the user to be taken to the next page...what command do i use?

-----------------------------------
recneps
Fri Jan 09, 2004 5:47 pm


-----------------------------------
either....
loop
exit when hasch
end loop
or
Input.Pause
the way it is written for hasch, will stop the program until a key is pressed(because it is processing and "empty" loop) but you can include in another loop, say to exit at any time.
Input.Pause just stops everything until a key is pressed. you dont need to hit enter for either

-----------------------------------
santabruzer
Fri Jan 09, 2004 6:40 pm


-----------------------------------
why not just use:
var ch : string (1)
getch (ch)


-----------------------------------
McKenzie
Fri Jan 09, 2004 6:45 pm


-----------------------------------
Santa's solution is better. The problem with just using hasch is that the key will not be processed...meaning that it won't work if you try it again (because hasch will still be true)

-----------------------------------
DanShadow
Fri Jan 09, 2004 6:52 pm


-----------------------------------
wow, your right....it wont work again. I forgot to take into account that the input buffer already has a key from the last loop, and is therefore carried on to the next loop....very perseptive Mckenzie! So just go forth and use the *getch (key )* command...it alwa ys works...or combine them:

if hasch then
getch(key)
end if


-----------------------------------
Andy
Fri Jan 09, 2004 8:00 pm


-----------------------------------
well considering hes a compsci teacher... and marks only codes he kinda has to

-----------------------------------
DanShadow
Fri Jan 09, 2004 8:15 pm


-----------------------------------
(psst) Dodge, I think your wrote that in the wrong topic (psst)
And yes...he kind of has to. CompScience gets very boring when your marking kids' programs which you can usually do 100x better...

-----------------------------------
Andy
Fri Jan 09, 2004 8:36 pm


-----------------------------------
? i was talking about mckenzie and the fact that you said he was very perseptive

-----------------------------------
recneps
Fri Jan 09, 2004 9:04 pm


-----------------------------------
see but you can have multiple

loop
exit when hasch
end loop

's so that itll stop at that one spot.. and if he doesnt need the char for anythin, input.pause is faster to write :), with no variable needed

-----------------------------------
CITC
Fri Jan 09, 2004 9:09 pm


-----------------------------------
so mackenzie using Input.Pause won't work more than once either?
also isn't there a command or a way of emptying the characters that have been inputed?

-----------------------------------
recneps
Fri Jan 09, 2004 9:44 pm


-----------------------------------
whats the program being made? is it like

drawoval(x,y,25,25,7)
put "Press any Key to continue."
%code here(whichever method you use)
draw box(x1,y1,x2,y2,7)



because if so, Input.Pause works, you dont need to declare a variable, and you dont need a loop or anything.
