Article View: comp.lang.pascal.delphi.misc
Article #316Re: WaitFor, TEvents and all that
From: Olaf Kaul
Date: Tue, 07 Nov 2000 00:00
Date: Tue, 07 Nov 2000 00:00
37 lines
1382 bytes
1382 bytes
On Tue, 7 Nov 2000 21:26:23 +1300, "Ian Boag"
<ianboag@partslink.co.nz> wrote:
>First I make a TEvent (MyEvent) and Create it.
>
>Form1.Create is
>MyEvent.Create(nil,false,false,'');
>
>Button1Click is then
> MyEvent.ResetEvent (turns it "off")
You did reset the event, before you started to wait for it.
For the Method "waitfor" the event will never be signaled.
> MyEvent.WaitFor(20000); (wait 20 seconds)
> write some sort of message
>
>Button2Click is just
> MyEvent.Set
>
try this in Button 1 Click:
case MyEvent.WaitFor(20000) of
wrSignaled:
Begin
MyEvent.ResetEvent;Edit1.text:='Signaled';
End;
wrTimeout:Edit1.Text:='timeout';
end;
Olaf
Technical Details
Message-ID:
<3a08628d.4239625@127.0.0.1>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<q2PN5.506$lvle.14549196@news.xtra.co.nz>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1043cf,dbd95fd5491965e8 X-Google-Attributes: gid1043cf,public X-Google-Thread: 10baee,dbd95fd5491965e8 X-Google-Attributes: gid10baee,public From: olaf.kaul@rz-online.de (Olaf Kaul) Subject: Re: WaitFor, TEvents and all that Date: 2000/11/07 Message-ID: <3a08628d.4239625@127.0.0.1> X-Deja-AN: 690937861 References: <q2PN5.506$lvle.14549196@news.xtra.co.nz> X-Posting-Agent: Hamster/1.3.21.0 X-Trace: fu-berlin.de 973630547 1313999 212.7.163.114 (16 [31171]) Reply-To: olaf.kaul@rz-online.de Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.objectpascal