{"id":44708349,"url":"https://github.com/ikelaiah/free-pascal-cookbook","last_synced_at":"2026-02-15T11:13:59.584Z","repository":{"id":292471433,"uuid":"841930139","full_name":"ikelaiah/free-pascal-cookbook","owner":"ikelaiah","description":"Free Pascal Cookbook","archived":false,"fork":false,"pushed_at":"2025-12-04T09:04:27.000Z","size":17892,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T21:37:45.041Z","etag":null,"topics":["basics","cookbook","free-pascal","freepascal","getting-started","guide","lazarus-ide","recipes","snippets"],"latest_commit_sha":null,"homepage":"https://ikelaiah.github.io/free-pascal-cookbook/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ikelaiah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-13T10:29:34.000Z","updated_at":"2025-12-05T14:42:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"79f695bf-4e86-435c-a216-3c9689c3c9c5","html_url":"https://github.com/ikelaiah/free-pascal-cookbook","commit_stats":null,"previous_names":["ikelaiah/free-pascal-cookbook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ikelaiah/free-pascal-cookbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikelaiah%2Ffree-pascal-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikelaiah%2Ffree-pascal-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikelaiah%2Ffree-pascal-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikelaiah%2Ffree-pascal-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikelaiah","download_url":"https://codeload.github.com/ikelaiah/free-pascal-cookbook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikelaiah%2Ffree-pascal-cookbook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29476300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T10:25:47.032Z","status":"ssl_error","status_checked_at":"2026-02-15T10:25:01.815Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basics","cookbook","free-pascal","freepascal","getting-started","guide","lazarus-ide","recipes","snippets"],"created_at":"2026-02-15T11:13:59.525Z","updated_at":"2026-02-15T11:13:59.579Z","avatar_url":"https://github.com/ikelaiah.png","language":null,"readme":"\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ikelaiah/free-pascal-cookbook/\"\u003e\n    \u003cimg src=\"docs/assets/logo-new-rounded-min.png\" alt=\"Logo\" width=\"256\" height=\"256\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eFree Pascal Cookbook | Source Files\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/ikelaiah/free-pascal-cookbook/releases/tag/v0.8\"\u003e\u003cimg src=\"https://img.shields.io/badge/version-0.8-blue\" alt=\"Version 0.8\"\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"License MIT\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.freepascal.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/language-Free%20Pascal-orange\" alt=\"Free Pascal\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.lazarus-ide.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/IDE-Lazarus-blue\" alt=\"Lazarus IDE\"\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    This repo contains the source files of my Free Pascal Cookbook, a mkdocs-material-based site.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/ikelaiah/free-pascal-cookbook/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://ikelaiah.github.io/free-pascal-cookbook/\"\u003eVisit Site\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/ikelaiah/free-pascal-snippets/\"\u003eView Snippets Repo\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nLearn **Free Pascal** with practical, ready-to-run examples. Whether you're a complete beginner or exploring Object-Oriented Pascal, this cookbook covers everything from \"Hello, World!\" to advanced concepts like generics and interfaces.\n\nThis cookbook is a collection of tutorials, code examples, and study notes for the [Free Pascal programming language](https://www.freepascal.org) and [Lazarus IDE](https://www.lazarus-ide.org).\n\n## What's Inside\n\nThis cookbook covers:\n\n- **Basics** - Variables, data types, and getting started with Free Pascal\n- **Control Flow** - Loops, conditions, and making decisions in code\n- **Functions \u0026 Procedures** - Writing reusable code and organizing your programs\n- **Object-Oriented Programming** - Classes, inheritance, encapsulation, and interfaces\n- **Advanced Topics** - Generics, pointers, and working with memory\n- **Practical Examples** - Real, ready-to-run code you can test immediately\n\n## Who Is This For\n\nThis cookbook is designed for:\n\n- **Complete beginners** to programming who want to learn Free Pascal from scratch\n- **High school students** (ages 15-18) exploring programming languages\n- **Developers** familiar with other languages who want to explore Object Pascal\n- **Hobbyists** interested in learning Free Pascal and Lazarus IDE\n- **Anyone** looking for clear, practical examples and explanations\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n### Online (Recommended)\n\nThe easiest way to start is to visit the cookbook site: [https://ikelaiah.github.io/free-pascal-cookbook](https://ikelaiah.github.io/free-pascal-cookbook)\n\nThe site is nicely formatted and easy to navigate. Just pick a topic and start learning!\n\n### Browse Locally\n\nYou can also browse the `.md` files directly in this repository. All the content is here; the website just makes it prettier to read.\n\n### Installation\n\nNo installation required! Everything you need is already here or linked from the cookbook. To **use** Free Pascal though, you'll need to:\n\n1. Install the [Free Pascal Compiler](https://www.freepascal.org/download.html)\n2. (Optional) Install the [Lazarus IDE](https://www.lazarus-ide.org/download/) for a more comfortable development experience\n\nBoth are free and work on Windows, macOS, and Linux.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- COMPILING CODE SNIPPETS --\u003e\n## Compiling Code Snippets\n\nAll code snippets in the cookbook are automatically extracted and compiled to ensure they work correctly. You can also experiment with the compiled executables.\n\n### How It Works\n\nThe `compile-all-snippets.ps1` PowerShell script:\n\n1. **Scans** all markdown files in the `docs/` directory\n2. **Extracts** Pascal code blocks marked with `` ```pascal ``\n3. **Classifies** snippets as:\n   - **Programs**: Complete, runnable programs (contain `program` + `begin`/`end`)\n   - **Units**: Reusable unit declarations (contain `unit` keyword)\n   - **Fragments**: Code examples or partial code (learning snippets)\n4. **Auto-generates filenames** using the pattern: `{markdown_filename}_{snippet_number}.pas`\n   - Example: `basic-hello-world_001.pas`, `basic-hello-world_002.pas`\n5. **Compiles** all Programs using the Free Pascal compiler (fpc)\n6. **Generates executables** you can run and experiment with\n7. **Generates reports** summarizing compilation results:\n   - `snippet_results.csv` - Detailed per-snippet data (machine-readable)\n   - `REPORT.txt` - Human-readable summary with statistics\n\n### Running Compilation\n\nTo compile all snippets:\n\n```powershell\n# Basic usage (uses default paths: .\\docs input, .\\build output)\n.\\compile-all-snippets.ps1\n\n# Custom paths\n.\\compile-all-snippets.ps1 -DocsPath \".\\docs\" -OutputDir \".\\build\" -FpcBin \"C:\\fpc\\bin\\fpc.exe\"\n```\n\n### Build Directory Structure\n\nAfter running the script, the `build/` folder will contain:\n\n- **Extracted snippets**: `{filename}_{###}.pas` - Source files and units extracted from documentation\n- **Compiled executables**: `{filename}_{###}.exe` - Runnable programs (for Programs only)\n- **Compiled units**: `*.ppu, *.o` - Object files and compiled units\n- **Logs**: `{filename}_{###}.log` - Compiler output and error messages\n- **Reports**: `snippet_results.csv`, `REPORT.txt` - Compilation statistics\n\nAll extracted units and programs are stored directly in `build/` for easy discovery and experimentation.\n\n### Support Libraries\n\nThe `build_support/` folder contains third-party and supplementary units required for compilation:\n\n- **`build_support/units/`** - Third-party unit source files:\n  - `ezthreads` - Threading and concurrency units\n  - `synapse` - Network and HTTP communication units\n  - Other specialized libraries for cookbook examples\n\n- **`build_support/libs/`** - External compiled libraries:\n  - `sqlite3.dll` - SQLite database library\n  - Other platform-specific libraries\n\nThese support files allow the snippets to compile with all necessary dependencies. Simply run `compile-all-snippets.ps1` and it will automatically locate and compile against these units and libraries.\n\n### Understanding Results\n\nThe script reports:\n\n- **SUCCESS**: Program compiled without errors ✅\n- **FAILED**: Program has compilation errors (check .log files for details) ❌\n- **SAVED**: Unit or fragment extracted and saved for reference (not compiled) 💾\n- **SKIPPED**: Fragment or partial code (cannot be compiled standalone)\n\nCheck `build/REPORT.txt` or `build/snippet_results.csv` for detailed results.\n\n### Cleaning Up\n\nTo remove all compiled artifacts and start fresh:\n\n```cmd\nclean-build.bat\n```\n\nThis removes all `.pas`, `.exe`, `.ppu`, `.o`, `.log` files and the reports.\n\n### Skipping Compilation for Specific Snippets\n\nSome code examples may intentionally contain memory leaks, unsafe patterns, or other issues suitable for educational discussion but not for automated compilation. Use the `\u003c!-- SKIP_COMPILE --\u003e` marker to prevent a snippet from being compiled:\n\n```\n\u003c!-- SKIP_COMPILE --\u003e\n'''pascal\nprogram MemoryLeakExample;\n{ This demonstrates a memory leak for educational purposes }\nbegin\n  // intentional memory leak shown here\nend.\n'''\n```\n\nThe script will:\n\n- Still extract and save the snippet for reference\n- Mark it as non-compilable to avoid failures\n- Include a note in the extracted file explaining why it was skipped\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n## Featured Topics\n\nNew to Free Pascal? Start with these:\n\n- [**Hello, World!**](docs/basics/basic-hello-world.md) - Your first Free Pascal program (choose IDE or CLI)\n- [**Data Types**](docs/basics/common-data-types.md) - Understanding numbers, text, and other data\n- [**Control Flow**](docs/basics/) - Making decisions with `if` and looping with `for`/`while`\n- [**Functions \u0026 Procedures**](docs/basics/) - Writing code you can reuse\n- [**Introduction to Object Pascal**](docs/basics/intro-objpas-fpc.md) - Explore classes and OOP concepts\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- GETTING HELP --\u003e\n## Getting Help\n\n**Have a question?** Here are some places to find help:\n\n- **Stuck on something in this cookbook?** Open an [issue on GitHub](https://github.com/ikelaiah/free-pascal-cookbook/issues) and I'll help!\n- **Want to learn more?** Check out the [Free Pascal Wiki](https://wiki.freepascal.org/) and [Lazarus documentation](https://wiki.lazarus.freepascal.org/)\n- **Join the community:**\n  - [Unofficial Free Pascal Discord](https://discord.gg/3VdxbSFyJP)\n  - [Free Pascal \u0026 Lazarus Forum](https://forum.lazarus.freepascal.org/)\n  - [Stack Overflow](https://stackoverflow.com/questions/tagged/freepascal) - Tag your questions with `freepascal`\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nThis is an open source project! If you find errors, have suggestions, or want to add examples, I'd love your help.\n\nYou can:\n\n- **Report issues** - Found a typo, unclear explanation, or code error? [Open an issue](https://github.com/ikelaiah/free-pascal-cookbook/issues)\n- **Suggest improvements** - Have ideas for new topics or better explanations? [Start a discussion](https://github.com/ikelaiah/free-pascal-cookbook/issues)\n- **Submit pull requests** - Feel free to fork, improve, and submit PRs!\n\nFor major changes, please open an issue first to discuss what you'd like to change.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE.md` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nIwan Kelaiah - https://au.linkedin.com/in/ikelaiah\n\nProject Link: [https://github.com/ikelaiah/free-pascal-cookbook](https://github.com/ikelaiah/free-pascal-cookbook)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\n- The FPC devs for sharing the joy of Object Pascal.\n- The Lazarus IDE devs for making such an amazing IDE.\n- The dedicated people behind various units/modules in OPM.\n- The kind and helpful individuals on various online platforms such as;\n\n    - [Unofficial Free Pascal discord server](https://discord.com/channels/570025060312547359/570091337173696513).\n    - [Free Pascal \u0026 Lazarus forum](https://forum.lazarus.freepascal.org/index.php).\n    - [Tweaking4All Delphi, Lazarus, Free Pascal forum](https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/).\n    - [Laz Planet - Blogspot](https://lazplanet.blogspot.com) / [Laz Planet - GitLab](https://lazplanet.gitlab.io).\n    - [Delphi Basics](https://www.delphibasics.co.uk/index.html).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikelaiah%2Ffree-pascal-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikelaiah%2Ffree-pascal-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikelaiah%2Ffree-pascal-cookbook/lists"}