Recent

Author Topic: Is There an Equivalent to VB6 DoEvents in Pascal?  (Read 2016 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Is There an Equivalent to VB6 DoEvents in Pascal?
« 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
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #1 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.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #2 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
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #3 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)


Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #4 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.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #5 on: May 25, 2019, 12:16:20 am »
Okay... will give it a try. Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

Zvoni

  • Hero Member
  • *****
  • Posts: 2317
Re: Is There an Equivalent to VB6 DoEvents in Pascal?
« Reply #6 on: May 25, 2019, 07:43:52 am »
A wise man once said: „Do, or do not. There is no try“
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018