Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
Predefined constant for GUI applications
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Executing build commands ...
by
ASBzone
[
Today
at 04:51:18 am]
parsing widechar string
by
alexeyneu
[
Today
at 02:40:20 am]
Update DBGrid row
by
egsuh
[
Today
at 02:31:20 am]
Scrollbox horizontal scro...
by
jamie
[
Today
at 02:10:32 am]
Installation
by
ASBzone
[
Today
at 02:05:54 am]
Best reading method
by
gii
[
Today
at 01:53:21 am]
[LazPaint] Layers: Loss o...
by
circular
[March 08, 2021, 11:02:49 pm]
[SOLVED] Is this a bug in...
by
Bart
[March 08, 2021, 10:25:48 pm]
Polished version of the C...
by
VTwin
[March 08, 2021, 09:41:47 pm]
Delphi 7 handling files
by
Iña123
[March 08, 2021, 09:38:07 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Predefined constant for GUI applications (Read 1244 times)
simone
Sr. Member
Posts: 373
Predefined constant for GUI applications
«
on:
March 11, 2019, 08:57:59 pm »
In order to conditionally compile some piece of code with FPC, is there a predefined constant that lets to discriminate if the source is a GUI program, i.e. is compiled with -WG option? Thanks in advance.
Logged
Microsoft Windows 10 64 bit - Lazarus 2.0.10
marcov
Global Moderator
Hero Member
Posts: 9091
FPC developer.
Re: Predefined constant for GUI applications
«
Reply #1 on:
March 11, 2019, 09:04:11 pm »
{$ifndef console}
Logged
simone
Sr. Member
Posts: 373
Re: Predefined constant for GUI applications
«
Reply #2 on:
March 11, 2019, 10:16:33 pm »
Very simple! I did not know this symbol because is not present on the official list:
https://www.freepascal.org/docs-html/current/prog/progap7.html#x333-349000G
Logged
Microsoft Windows 10 64 bit - Lazarus 2.0.10
Thausand
Full Member
Posts: 234
Re: Predefined constant for GUI applications
«
Reply #3 on:
March 12, 2019, 06:59:13 am »
hello,
You write not official list is console but is written in other part here
https://www.freepascal.org/docs-html/prog/progse3.html#progsu86.html
It writes "Global directives" and for console you watch part AppType here
https://www.freepascal.org/docs-html/prog/progsu86.html#x94-930001.3.3
There it writes "console" and more.
so is official
Logged
PascalDragon
Hero Member
Posts: 2761
Compiler Developer
Re: Predefined constant for GUI applications
«
Reply #4 on:
March 12, 2019, 09:01:59 am »
Quote from: marcov on March 11, 2019, 09:04:11 pm
{$ifndef console}
Please note that this will only work in the main project file or if all units are recompiled.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
Predefined constant for GUI applications
TinyPortal
© 2005-2018