Free Pascal Cookbook¶
Welcome to my Free Pascal Cookbook!
You'll find useful snippets and study notes for Object Pascal using the Free Pascal Compiler (FPC) and Lazarus IDE—perfect for saving time and making your coding journey smoother!
If you're seeking tutorials and in-depth technical discussions, don't miss Resources.
Install FPC Official Documentation
Why Free Pascal?¶
Productive
Build apps quickly using visual tools and straightforward event handling.
Cross-Platform
Write code once and run it on Windows, macOS, Linux, and more!
Readable
Easy-to-understand code that helps you find and fix mistakes quickly.
Native & Fast
Programs compile directly to machine code, making them run super fast.
Stable & Modern
Reliable for big projects and supports cool new programming features.
Rich Ecosystem
Lots of ready-to-use components and great for working with databases.
Official Documentation¶
Want to dive deeper? The official documentation is a great resource. Here are some starting points:
Free Pascal Compiler (FPC)
- User's Guide: Learn the basics of using the compiler.
- Programmer's Guide: Explore programming with Free Pascal.
- Language Reference: The complete guide to the Object Pascal language.
- For all FPC guides, see the FPC Documentation Page.
Lazarus IDE
- Lazarus Documentation: Your main hub for Lazarus guides, including the LCL (Lazarus Component Library).
- Lazarus FAQ: Find answers to common questions.
Installation¶
You need the Free Pascal Compiler (FPC) to run the snippets locally on your machine.
- Download the Lazarus IDE installer for your platform to install both FPC and Lazarus IDE.
- Alternatively, get the fpcupdeluxe for your OS.
- Download the FPC installer for your platform.
- Alternatively, get the fpcupdeluxe for your OS, and only install the Free Pascal Compiler.
Latest release: FPC 3.3.2, Lazarus IDE 3.6.
Code Repos¶
Curious where the magic happens? You can explore the source code for Free Pascal and Lazarus:
- The repo of the Free Pascal Compiler: FPC - Gitlab
- The repo of the Lazarus IDE: Lazarus IDE - Gitlab
- The repo of the snippets: https://github.com/ikelaiah/free-pascal-snippets.
Acknowledgments¶
- The FPC devs for sharing the joy of Object Pascal.
- The Lazarus IDE devs for making such an amazing IDE.
- The dedicated people behind various units/modules in OPM.
-
The kind and helpful individuals on various online platforms such as;
Note
Code snippets on this site work with FPC 3.2.2
and Lazarus 3.6
on Win 11.
Warning
This document is a work in progress.
Contents are still being revised and added.