What is a Delphi Console Application?While originally Delphi was developed for writing Windows applications with a "Graphical User Interface" (GUI), you can also use it for Console Applications. Worldwide, teachers use these pure text programs for teaching Pascal. Hey, back to the pre-historic DOS days! When you start a console application, Windows creates a text-mode console window through which the user can interact with the application. Note that a console program is not a DOS program, because it can call Windows functions. Setting up a simple console applicationThe main source code for a console application is contained in a textfile with a .DPR extension, a Delphi Project file. If desired, you can add additional source code units, .PAS files, but for simple programs this is not necessary. Console applications don't use the visual controls of Delphi's Visual Controls Library (VCL). So, since there are no "forms", there are no .DFM files. If your Delphi version is newer than 4, it's very easy to set up a new console application with the Console Application Wizard: 1. Select File
/ New / Other... This opens the New Items dialog window. 2. Select the Console Application icon and click OK. In the code editor, you now see a program template: program Project1; {$APPTYPE CONSOLE} uses SysUtils; begin // Insert user code here end. If your Delphi version is 4 or earlier, you have to do a bit more manual work to create an empty console project:
A simple example
|
|
TOP :: Source
Code and Tutorials :: Crash Course Delphi :: Forum
DelphiLand Club
TURBO Delphi Explorer FAQ ::
DC Library :: Tips ::
Downloads :: Links
© Copyright 1999-2007
Studiebureau Festraets