Compiler Directive
Determines the application type : GUI or Console
1   {$AppType GUI}
2   {$AppType CONSOLE}
The $AppType compiler directive sets the application type. The default is for Graphical applications.
When you create a Console application in Delphi, it automatically inserts a {$AppType CONSOLE} statement near the start, with no forms or other such clutter.
A console application allows you to write/read to/from the console Input and Output files using Read, ReadLn, Write and WriteLn statements without the need to perform AssignFile, Reset or ReWrite operations. Nor do you have to specify the file names - as show in the example code.
A GUI application does not need an $AppType statement - GUI is the default.
Related commands
ReadLn Read a complete line of data from a text file
WriteLn Write a complete line of data to a text file
 Author links

 Download this web site as a Windows program.

Example code : A simple console application
program Project1;

{$AppType CONSOLE}


  name : string;

  WriteLn('Please enter your name');
  WriteLn('Your name is '+name);
  WriteLn('Press enter to exit');
   Example console output :
   Please enter your name
   Joe Bloggs
   Your name is Joe Bloggs
   Press enter to exit
'); document.write('
'); document.write('
Delphi Programming Neil Moffatt 2002 - 2020. All rights reserved.  |  Home Page