Monday, July 11, 2022

Project Setup

Download and install the Delphi Pascal IDE. A free license is provided for the community edition.

Run the program and select "Create a new Windows VCL Application - Delphi" from the Welcome Page or select File > New > Windows Windows VCL Application - Delphi.

Hint: VCL is a the traditional desktop development library for Windows computers and is similar to WinForms in VisualStudio. Delphi supports a newer cross-platform windowing system called FMX. For this tutorial, I will use VCL.


In the projects windows, right click on "Target Platforms (Windows 32-bit)" > Add Platform > Ok to select Windows 64-bit (assuming you are woring on a 64-bit computer). Also, select "Release" in the Build Configuration for faster build times and small executable code. We will use Debug as needed to resolve development "bugs".

Save the Project Group, Project, and Source Files

Create a project directory such as Desktop > EngineeringTools-Pascal. Create a project directory called Desktop > EngineeringTools-Pascal > HelloPascalWindow. Select File > Save All. Save the .pas file as HelloWindow.pas in the HelloPascalWindow project directory. Save the project as HelloWorldProject.dproj in the HelloPascalWindow project directory. Right click on the project group name in the Projects window and select Save Project Group As... Save the project group as HelloWindowProject in the EngineeringTools-Pascal directory. The project directories should look like this:



Project Organization

  • Project Group - Collection of projects (similar to Solution in Visual Studio)
  • Project - Collection of pascal source code files
  • *.pas - Pascal source code file
  • *.dfm - Form source code file
Pallete window contains the graphical library of controls that can be used on the VCL form.
Object Inspector window provides access to control properties and events.
Structure window provides a list of controls.

Project Compilation
Select the Form, in the object inspector change the Caption to Hello Pascal Window. Select Run > Run Without Debugger or click on the green arrow in the Dephi toolbar. The project is compiled and the following window is displayed:


Congradulations! You created your first pascal window. Close the window by clicking on the close icon in the upper right.  

The executable for this project can be found in the Desktop\EngineeringTools-Pascal\HelloPascalWindow\Win64\Release directory. Run the executable by double clidking on it to see the bare window from a standalone executable.





No comments:

Post a Comment

Scientific Calculator

To get familiar with VCL form application development, let's create a simple scientific calculator. This example is based on  How to Cre...