Type Parameter
Syntax {$APPTYPE GUI} or {$APPTYPE CONSOLE}
Default {$APPTYPE GUI}
Scope Global
The $APPTYPE
directive controls whether to generate a Win32 console or graphical UI
application.
In the {$APPTYPE GUI} state, the compiler generates a graphical UI application. This is the normal state for a Delphi application.
In the {$APPTYPE
CONSOLE} state (equivalent to the /CC command-line option), the
compiler generates a console application. When a console application is
started, Windows creates a text-mode console window through which the user can
interact with the application. The Input and Output standard text files are
automatically associated with the console window in a console application.
The
IsConsole Boolean variable declared in the System unit can be used to detect
whether a program is running as a console or graphical UI application.
The $APPTYPE directive is meaningful only in a program. It should not be used in a library, unit, or package.