Learn Object Pascal
Part 1 - IntroductionIn these series of tutorials we will see how you can make native desktop applications for Windows / Linux and MacOS using Object Pascal.
I am doing these series of tutorials since the online tutorials about Object Orienatation Programming and Pascal are not that well structured.
I will give you real life examples.
You can consider Object Pascal as the free flavor of Delphi.
The most common free Object Pascal compiler is freepascal.
We are going to use CodeTyphon as our main compiler GUI.
Compiler and IDE/GUI are all free even for commercial use.
CodeTyphon comes with more libraries installed than Lazarus which is the official freepascal IDE GUI.
Some of most famous desktop programs have been implemented in Delphi / Lazarus like :
- Nero Burning Rom
- Fruity Loops-Digital Audio Workstation
- Gold Wave
- Altium Designer Board
- Space Rangers
- Total Commander
- Avant browser
- Panda Titanium Antivirus
- Partition Magic
Let's start by installing CodeTyphon.
Download and unzip CodeTyphon from the official web site.
Extract CodeTyphon into a simple path like : "D:\"
On Windows CodeTyphon request DirectX End-User Runtime package.
You must download and install DirectX End-User Runtimes package, in order to compile CodeTyphon BigIDE, even if you do not plan to use DirectX components in your projects
Click "Start", click "All Programs", and then click "Accessories".
Right-click "Command prompt", and then click "Run as administrator".
If the User Account Control dialog box appears click "Continue".
On the command prompt window write : "D:\CodeTyphonIns\install.bat" in order to install CodeTyphon under Windows.
Under Linux open console and do:
su nano /etc/sudoers
Once you have the sudoers file open with nano, add as last line:
your_user_name ALL = (ALL) NOPASSWD: ALL
Pres Ctrl+X to exit from nano and choose save (y/Y).
Now in order to install CodeTyphon under Linux do:
cd CodeTyphonIns (go to CodeTyphonIns folder)
Now on Windows / Linux do:
Select option number (0): "Install CodeTyphon Studio"
(0) "Install System Libraries" (if this option is available) and then
(8) "Remove and Build ALL"
This operation can take up to 1 hour on older systems.
After installation you can delete "CodeTyphonIns" folder.
If you need more help please visit the official wiki page and select "Installation" section.
Notice that under Vista 64bit, Windows 7 64bit and Windows 8 64bit you can run both 32bit and 64bit Typhon IDE so you can make 32/64 bit applications.
Under Linux i suggest to install natively a 64 bit system and by using VirtualBox you can install virtually a 32 bit lightweight system like Linux Mint Xfce LTS.
You have to install CodeTyphon into both Linux 64 bit and your Virtual Linux 32 bit. By doing this procedure you can compile 32 and 64 bit applications under Linux.
If you want to update your CodeTyphoon IDE
Right click the "CodeTyphon Center" icon.
Then hit "Properties" from "Compatibility" tab check "Run this program as administrator".
Now double click the "CodeTyphon Center" icon.
from the console do "sudo codetyphon"
Now under Windows / Linux do:
From the Tab "CodeTyphon" hit "Update Manager" like the photo below :
Hit the "Check for all updates" button like the picture below:
and then hit the "Start Update..." button like the picture below:
then in the command promt box select (8) "Remove and Build ALL"
That's all for now !
I will keep the sections short in order to make easier for reading.
In the next page we will create our first program.
[[ Part 1: Introduction ]] - Part 2: Hello World - Part 3: Data types, constants and variables - Part 4: Operators - Part 5: Decisions and Loops - Part 6: Procedures and Functions - Part 7: Custom datatypes - Part 8: Enumerations, subranges and sets - Part 9: Records