Re: Calling a procedure with loop
- From: erewhon@xxxxxxxxxx (J French)
- Date: Sun, 16 Oct 2005 09:52:29 +0000 (UTC)
On 15 Oct 2005 07:25:46 -0700, kinchun3@xxxxxxxxx wrote:
Apart from the other points, would this not be better in a Timer
Does it really need to run so fast ?
What are you doing in //Stuff ?
>procedure TForm1.ProcName;
>var i: integer;
>begin
>repeat
>begin
>//stuff
>Application.ProcessMessages;
>sleep (1);
>if (GetKeyState(VK_RETURN) and 1)=1 then break;
>until 0=1;
>end;
>
>procedure TForm1.Button1Click(Sender: TObject);
>begin
>ProcName;
>end;
>
>procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
>begin
>if Key = 'a' then
>ProcName;
>end;
>
>Basically what happens: When I press 'a', it would go into the loop,
>but break out of the loop without looping. The same thing happens when
>I click on Button1.
>
>How do I solve this problem?
>
.
- Follow-Ups:
- Re: Calling a procedure with loop
- From: Ruce
- Re: Calling a procedure with loop
- References:
- Calling a procedure with loop
- From: kinchun3
- Calling a procedure with loop
- Prev by Date: Re: Calling a procedure with loop
- Next by Date: Re: Calling a procedure with loop
- Previous by thread: Re: Calling a procedure with loop
- Next by thread: Re: Calling a procedure with loop
- Index(es):
Relevant Pages
|