Mega Code Archive

 
Categories / Delphi / Strings
 

How can i yield the cpu to other tasks, like doevents in vb

The Delphi equivalent is Application.ProcessMessages. There is also an API function called Yield that seems to do the same thing, but it isn't safe to use from most Delphi applications. Steve Teixeira <steixeir@borland.com> explains: You should not use Yield() unless your application is *guaranteed* not to receive any messages (ie, your application contains no windows). Instead, the way to do this in Delphi is to call Application.ProcessMessages. ProcessMessage encapsulates a PeekMessage() loop, which is the correct "API-way" to do this.