[Lazarus] What to replace Application.Processmessages with?
Bo Berglund
bo.berglund at gmail.com
Sun Nov 1 11:48:54 CET 2020
On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via
lazarus <lazarus at lists.lazarus-ide.org> wrote:
>> QUESTION:
>> Is there a way in code to check if Forms is used?
>> So it can be used instead of {$IFDEF NOGUI}
>
>normally
>
>{$IF DECLARED(Forms)}
>or
>{$IF DECLARED(TForm)}
>
>should do the trick for you.
>
I created this command line program:
program Test;
begin
Writeln('I will test the TForm check now:');
{$IF DECLARED(TForm)}
Writeln('TForm is declared...');
{$ELSE}
Writeln('Apparently TForm not declared');
{$ENDIF}
Writeln('I will test the Forms check now:');
{$IF DECLARED(Forms)}
Writeln('Forms is declared...');
{$ELSE}
Writeln('Apparently Forms not declared');
{$ENDIF}
end.
When I run it in a console:
$ ./Test
I will test the TForm check now:
Apparently TForm not declared
I will test the Forms check now:
Apparently Forms not declared
However in the Lazarus code editor the lines inside the {$ELSE}
clauses are shown as disabled even though these are the ones actually
present and running in the build...
--
Bo Berglund
Developer in Sweden
More information about the lazarus
mailing list