Lazarus

Programming => General => Topic started by: pixelink on May 24, 2019, 11:21:08 pm

Title: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: pixelink on May 24, 2019, 11:21:08 pm
Is there an equivalent in Pacal/LAZ of the DoEvent in VB6??
Did some googling and didn't find much info for pascal.

Thanks
Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: marcov on May 24, 2019, 11:23:28 pm
If I try to google VB6, it seems to run the Windows message pump.

In that case, it is Application.ProcessMessages in GUI apps.
Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: pixelink on May 24, 2019, 11:29:43 pm
If I try to google VB6, it seems to run the Windows message pump.

In that case, it is Application.ProcessMessages in GUI apps.

?? DoEvents is an actual command in VB6 that kind of works like a thread.

It frees up the programs while it processes a task
Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: marcov on May 24, 2019, 11:39:08 pm
When I googled, I found this from https://stackoverflow.com/questions/4526659/what-does-doevents-do-in-vb6  :

"DoEvents() allows other Windows messages to be processed"

The problems described are exactly the same as with Application.Processmessages (in case of overuse or misuse)

Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: Edson on May 24, 2019, 11:45:45 pm
In Lazarus "Application.Processmessages" do the trick.

Consider Lazarus have better techniques to maintain the GUI working where processing something, like Threads.
Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: pixelink on May 25, 2019, 12:16:20 am
Okay... will give it a try. Thanks
Title: Re: Is There an Equivalent to VB6 DoEvents in Pascal?
Post by: Zvoni on May 25, 2019, 07:43:52 am
A wise man once said: „Do, or do not. There is no try“
TinyPortal © 2005-2018