On Sun, 01 Nov 2020 11:37:14 +0100 Bo Berglund via lazarus <lazarus@lists.lazarus-ide.org> wrote:
> On Sun, 1 Nov 2020 10:20:11 +0100 (CET), Michael Van Canneyt via > lazarus <lazarus@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. > > 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)} Not yet supported by codetools, i.e. in the IDE. Codetools simply evaluates "declared()" to true. > Application.ProcessMessages; > {$ENDIF} Test compile by adding some invalid line like aaa; Mattias -- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus