Thanks
 
 I noticed that "sleep" should be renamed "stultify"
 as it obvoiusly doesn't dream (of electric or any other sheep)
 
 N
 
> ----- Original Message ----- 
> From: "Alistair Grant George" <[EMAIL PROTECTED]>
> To: "Neven MacEwan" <[EMAIL PROTECTED]>
> Sent: Thursday, November 27, 2003 12:13 PM
> Subject: Re: [DUG] idle function
> 
> 
> > Hello Neven,
> > U gotta be a wee bit careful about sleep, how u use it.
> > Here is one method that works well for me:
> > procedure Delay(ms: dword);
> > var
> >   TheTime, tenth: dword;
> > begin
> >   TheTime := GetTickCount + ms;
> >   Tenth := 0;
> >   while GetTickCount < TheTime do
> >   begin
> >     sleep(1);
> >     inc(tenth, 1);
> >     if tenth > 99 then
> >     begin
> >       tenth := 0;
> >       application.processmessages;
> >     end;
> >   end;
> > end;
> > 
> > or another way:
> > 
> > function YieldProcess: Boolean;
> > var
> >   msg: TMsg;
> > begin
> >   while PeekMessage(msg, 0, 0, 0, PM_REMOVE) do
> >     begin
> >       if msg.message = WM_QUIT then
> >         begin
> >           PostQuitMessage(msg.wParam);
> >           Result:= True;
> >           EXIT;
> >         end
> >       else
> >         begin
> >           TranslateMessage(msg);
> >           DispatchMessage(msg)
> >         end
> >     end;
> >   Result:= False;
> > end;
> > 
> > 
> > 
> >
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to