Suck it and see; if the resolution of the machine is significantly greater
than the incoming events, all should be well and good.
Cheers.

A flag implies a line of code that says
//No, flag should be getting the number of events var flag:integer;

xxxxx.onevent(blabla)
begin
flag:=flag+1;
if flag>1 then exit;
   while flag >0 do
// now, unless my understanding of reentrant pascal is err, if an onevent
occurs here the loop breaks & does the onevent,
//incs flag, exits, then continues in this loop where it was exited
begin
   flag := flag-1;
   // do stuff
end;
end;
intialization flag:=0;
The concern is as to whether it is possible for two instances to exit
the loop before one of them has set the flag to true?

Steven

> Place a global counter in the onevent handler, inc the event each
> time an instance occurs and dec the event each time a loop is completed
> in a for.. or while.. loop, which keeps running till the loop is zeroed,
in the same eventhandlerproc.
>
> I have an event that can be triggered many times.  Each instance can
> be very close to the previous one.
>
> I want to avoid having two instances of the event method running at
> once or at least be able to cause all instances to delay completing
> while the first/current one finishes.
>
> Effectively I want them to queue.
>
> How do I do it??
>
> Steven
>
>
> Wild Software Ltd
> P O Box 33-216
> Christchurch
> NEW ZEALAND
>
> =========================================================
> I haven't lost my mind; it's backed up on tape somewhere.
> =========================================================
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>
>
>


Wild Software Ltd
P O Box 33-216
Christchurch
NEW ZEALAND

=========================================================
I haven't lost my mind; it's backed up on tape somewhere.
=========================================================
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to