View previous topic :: View next topic |
Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Dec 08, 2007 6:52 pm Post subject: Pause in delphi? |
|
|
How do you do the pause thing in Delphi council application?
for batch you use : pause
for C++ you use : system('PAUSE');
|
|
Back to top |
|
 |
newb09 Master Cheater
Reputation: 0
Joined: 02 Feb 2007 Posts: 350
|
Posted: Sat Dec 08, 2007 6:59 pm Post subject: |
|
|
use sleep
_________________
NOOBXOR = Comes from the root words noob and haxor, hence noobxor.
word created by: newb09 & ferenzo
 |
|
Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Dec 08, 2007 7:04 pm Post subject: |
|
|
no i ment using so that you hit any key then it cotinues.
|
|
Back to top |
|
 |
newb09 Master Cheater
Reputation: 0
Joined: 02 Feb 2007 Posts: 350
|
Posted: Sat Dec 08, 2007 7:06 pm Post subject: |
|
|
oh um... i know how but i want u to help me with my code plz. lol hold on let me look at the one i made in delphi. ill post how in just a sec.
_________________
NOOBXOR = Comes from the root words noob and haxor, hence noobxor.
word created by: newb09 & ferenzo
 |
|
Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Dec 08, 2007 7:08 pm Post subject: |
|
|
jsut use that for(; look and if the handle isn't 0 then break the loop. Like I showed u in the PM. BTW. its at the bottom...
|
|
Back to top |
|
 |
newb09 Master Cheater
Reputation: 0
Joined: 02 Feb 2007 Posts: 350
|
Posted: Sat Dec 08, 2007 7:13 pm Post subject: |
|
|
try the onkeypress event actually. it should work idk i dont have delphi now i uninstalled it
_________________
NOOBXOR = Comes from the root words noob and haxor, hence noobxor.
word created by: newb09 & ferenzo
 |
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Dec 08, 2007 7:36 pm Post subject: |
|
|
Code: |
program SysPause;
{$APPTYPE CONSOLE}
uses
SysUtils, Windows;
function PauseConsole(Prompt: PAnsiChar): boolean;
var
hStdIn, hStdOut: THandle;
dwRd, dwWr, i: Cardinal;
cBuf: array [0..128] of TInputRecord;
begin
result := false;
hStdIn := GetStdHandle(STD_INPUT_HANDLE);
hStdOut := GetStdHandle(STD_OUTPUT_HANDLE);
if ((hStdIn <> 0) and (hStdOut <> 0)) then
begin
WriteFile(hStdOut, Prompt[0], lstrlen(Prompt), dwWr, nil);
while ReadConsoleInput(hStdIn, cBuf[0], 128, dwRd) do
begin
for i := 0 to dwRd do
begin
if ((cBuf[i].EventType = KEY_EVENT) and (cBuf[i].Event.KeyEvent.bKeyDown)) then
begin
result := true;
exit;
end;
end;
end;
end;
end;
begin
try
PauseConsole('Press a key to continue.');
except
on E:Exception do
Writeln(E.Classname, ': ', E.Message);
end;
end.
|
_________________
|
|
Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Dec 08, 2007 8:11 pm Post subject: |
|
|
thanks?
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Dec 08, 2007 10:09 pm Post subject: Re: Pause in delphi? |
|
|
dnsi0 wrote: | How do you do the pause thing in Delphi council application?
for batch you use : pause
for C++ you use : system('PAUSE'); |
Just a suggestion do not use system("PAUSE"), it is a waste of resources and is very poorly designed.
Instead either use:
Or
Code: | cin.get();
cin.sync(); |
_________________
- Retired. |
|
Back to top |
|
 |
|