Useful Articles for designing software with Delphi
Here are some Useful Articles for designing and coding software in Delphi.
They range from early Delphi 1 techniques to current VCL and TMS WEB Core code, and
most include working source code.
- Extending Project History List in Delphi 1
Delphi 1 tips, including extending the IDE list of recently closed projects, showing the primary index in DataList, and controlling the cursor during long processes. - Using Form Components With Delphi 1
Create reusable form components in Delphi 1 from a unit of form definitions, so common form code is written once and inherited. - Better Calculated Fields in Delphi
Calculated fields you can read and write at any time, without an OnCalcFields handler or edit mode, using interposer classes. First published in The Delphi Magazine, March 1999. - How to convert Web colour to Delphi or vice versa?
Convert between HTML hex colours and Delphi / Windows TColor values in either direction. - How to create a virtual table on TMS Webcore XData Client?
Implement a virtual (in-memory) table on a TMS WEB Core XData client. - How to handle nil pointers in TMS Webcore?
Handle nil procedure pointers safely in TMS WEB Core, and the difference between procedure pointers and anonymous methods. - Convert Left Click to Right Click in TMS Webcore
Open context menus from a left click in TMS WEB Core. - PBS Delphi Logger - Thread-safe logging with multiple outputs
Thread-safe logging to files, console or a TMemo, with daily rotating log files and automatic pruning. Full source code available. - Input Sanitization and Validation for Delphi
A single-unit class that strips HTML, escapes SQL and normalises whitespace in user input. Full source code included. - Delegating an Interface to a Property in Delphi (implements)
How the implements keyword lets a class delegate an interface to a property, with a working example, the compiler rules and the reference-counting pitfalls. - Interposer Classes in Delphi
Change the behaviour of components and fields already on your forms without writing new components - the rules, VCL and TMS WEB Core examples, and the pitfalls. - How to Stop the Red Error Panel in TMS WEB Core
Why unhandled errors appear in a red panel, why try-except cannot catch them, and how to show every error as a normal message instead. - How to Send Int64 Values from Delphi to JavaScript Without Losing Precision
JavaScript rounds integers above 2^53. Send Int64 values as hex and read them in TMS WEB Core with a two-halves record. Tested code for server and browser. - How to Store and Transfer Delphi Sets with More Than 64 Elements
A set of up to 128 elements as two Int64 words, in two MySQL BIGINT columns and in the browser, with the same set type on both sides. - Delphi Warnings W1050, W1057 and W1058 Explained - and How to Fix Them
Which string and character warnings point at real bugs, and fixes that keep ShortString and AnsiChar code fast. Measured on Delphi 13. - Sharing Units Between VCL and TMS WEB Core (pas2js)
One unit for the server and the browser: what pas2js does not accept, the defines to test, and the Int64 and Currency differences. - GET or POST for TMS XData Service Operations
What changes on the wire, when each method is right, and how to change one without breaking clients. Tested against a running XData server. - How to Prove a Refactor Is Safe Without Unit Tests
Run the old and new versions side by side on a million generated inputs and report every difference. A complete console program. - Role-Based Access Control: Check Deny Rules Before Admin Bypass
Why "if admin then allow" first lets administrators write to read-only data, and the order of checks that fixes it. - Delphi Hint H2443: Inline Function Has Not Been Expanded
What the hint means, the one-line fix, what it costs if left, and what it means for your own inline functions. - TMS WEB Core Components Are Nil at Runtime - Causes and Fixes
Forms used before they load, units missing from the project, exceptions while a form loads, fields with no DFM object and failed builds. Each cause tested. - Using Claude Code on a Delphi Project
A CLAUDE.md for Pascal, letting it compile with MSBuild, and what it gets wrong - DFM and .dproj files, files open in the IDE, and UTF-8 source without a BOM. - How to Call the Claude API from Delphi
A complete unit using THTTPClient: conversations, effort, retries, refusals, streaming replies, and calling it from a VCL form without freezing the UI. - How to Write an MCP Server in Delphi
A complete Model Context Protocol server in one Delphi program, testing it by hand, and connecting it to Claude Code and Claude Desktop. - Migrating VCL Forms to FireMonkey with an AI Assistant
What an AI assistant converts well, what it gets wrong - fonts, colours, canvas drawing, Windows calls, data-aware controls - and a workflow that catches it. - Using an AI Coding Assistant with TMS WEB Core
Keeping the assistant writing Pascal instead of asm blocks, and the pas2js and XData quirks it needs to be told about.
Free tool : Delphi Version Lookup
finds any Delphi version by codename, VER define or CompilerVersion.
Free source code : VCL Last Gunman Standing
- the Josephus problem solved two ways, with TList and with TQueue.
Articles for designing and coding software with Delphi