| View previous topic :: View next topic |
| Author |
Message |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Mon Mar 03, 2008 3:34 am Post subject: [Delphi] Press any key to continue... |
|
|
| I'm making a console application, and I want to wait for any input before exiting. How can I do this?
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Mar 03, 2008 4:21 am Post subject: |
|
|
declare a global boolean, call it Fuck.
Fuck:Boolean;
use the while loop
| Code: | begin
Fuck:=True;
While Fuck = True do
begin
if odd(GetAsyncKeyState(VK_FX)) then {Do w.e you want}
Fuck:=False;
end;
end. |
Edit: Holy macaroni, i forgot to tell you, the X in VK_FX is a number.
F1 for example..
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Mon Mar 03, 2008 4:48 am Post subject: |
|
|
| Rot1 wrote: | declare a global boolean, call it Fuck.
Fuck:Boolean;
use the while loop
| Code: | begin
Fuck:=True;
While Fuck = True do
begin
if odd(GetAsyncKeyState(VK_FX)) then {Do w.e you want}
Fuck:=False;
end;
end. |
Edit: Holy macaroni, i forgot to tell you, the X in VK_FX is a number.
F1 for example.. |
There isn't any way other than calling GetAsyncKeyState?
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Mar 03, 2008 4:52 am Post subject: |
|
|
| Xenophobe wrote: | | Rot1 wrote: | declare a global boolean, call it Fuck.
Fuck:Boolean;
use the while loop
| Code: | begin
Fuck:=True;
While Fuck = True do
begin
if odd(GetAsyncKeyState(VK_FX)) then {Do w.e you want}
Fuck:=False;
end;
end. |
Edit: Holy macaroni, i forgot to tell you, the X in VK_FX is a number.
F1 for example.. |
There isn't any way other than calling GetAsyncKeyState?  |
umm...RegisterHotKey ?
other than those two i don't know, sorry.
Edit: i looked at my earlier code, it wont work.
do this:
| Code: | Fuck:=True;
While Fuck = True do
if odd(GetAsyncKeyState(VK_FX)) then
begin
{Do w.e you want}
Fuck:=False; //Escaping from the loop here...
end;
End; |
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Mar 03, 2008 8:19 am Post subject: |
|
|
Check out this example:
http://www.festra.com/wwwboard/messages/2569.html
They show using readkey after spitting out a message then checking the input:
| Code: | begin
message := 'press any key to continue';
write(message);
response := readkey;
if (response = P) then halt;
writeln;
end; |
_________________
- Retired. |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Mar 03, 2008 9:13 am Post subject: |
|
|
| well, i don't code much in console (pascal), only in C (still learning) cause i idk how to use UI in MSVC++ 6.0
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Mon Mar 03, 2008 9:25 am Post subject: |
|
|
| Rot1 wrote: | | well, i don't code much in console (pascal), only in C (still learning) cause i idk how to use UI in MSVC++ 6.0 |
Explanations, explanations kaspersky
|
|
| Back to top |
|
 |
|