Re: Sleep function


2003-07-04 11:52:18 AM
delphi69
Quote
Sleep function is not working properly. Specially in a loop which I want to
move an image step by step to simulate a moving image (say from left to
right)
Sleep will cause the system to "Sleep" which means no messages in the meantime,
you can write something like this:
procedure Form1.delay(const ms: Longint);
var
TheTime : LongInt;
begin
TheTime := GetTickCount + ms ;
while GetTickCount < TheTime do Application.ProcessMessages ;
end;
This should be better...
--
Liran
www.com-n-sense.com