[Lazarus] What to replace Application.Processmessages with?

Michael Van Canneyt michael at freepascal.org
Sun Nov 1 11:50:29 CET 2020



On Sun, 1 Nov 2020, Bo Berglund via lazarus wrote:

>> should do the trick for you.
>
> A quick test:
> It seems like there is a problem with this...
> I added this to the end of a random function:
>
>  {$IF DECLARED(TForm)}
>    Application.ProcessMessages;
>  {$ENDIF}
>
> Even though the project does not use Forms (Search/Find in Files in
> all project files does not find it) the code within the block is
> marked enabled and a quick compile succeeds.
>
> No file in the project declares Forms as a used unit.
> Same thing happens if I check for Forms in the code above...
>
> If I try to use the right-click/FindDeclarationOf on Processmessages
> pops up an error:
> class_SSRemoteServer.pas(530,5) Error: identifier not found:
> Application
>
> However, the app builds...
> So maybe this is a problem with the Lazarus code editor not being able
> to parse the {$IF DECLARED(TForm/Forms)} item?

I can't comment on this.

>
> To really check this I need to create a test app and run it in the
> debugger, I guess..
> In a command line program it should not generate code, right?

Yes.

Michael.


More information about the lazarus mailing list