Recent

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

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
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!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8887
  • 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: 1243
    • Pixelink Software
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!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8887
  • 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: 1109
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.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

pixelink

  • Hero Member
  • *****
  • Posts: 1243
    • Pixelink Software
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!

Pixelink Media
LAZ 2.08 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

Zvoni

  • Sr. Member
  • ****
  • Posts: 423
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 IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

 

TinyPortal © 2005-2018