An improved Abstract Error Handler for Delphi

NOTE: The original blog post was wrong in one point: The change happened in Delphi XE2, not 10.2. I have now updated this and also adapted the conditional compilation in u_dzAbstractHandler. I should also mention, that the code only works on Win32. Win64 and other platforms are not supported. But since that unit won't compile … Continue reading An improved Abstract Error Handler for Delphi

Switching GetIt to Online mode for an alternate Delphi configuration

GetIt is the package manager built into the Delphi IDE. It can be used in Online and Offline mode. If you installed Delphi from an ISO, GetIt was left in Offline mode. That has some drawbacks: GetIt cannot notify you about new updates or patches as they become available. The "Manage Features" functionality of the … Continue reading Switching GetIt to Online mode for an alternate Delphi configuration

Universal Debug Visualizer for Delphi

As mentioned in my previous post on dzDebugVisualizer I was thinking about writing a generalized debug visualizer which can be user-configured to register itself for any data type. Well, that debug visualizer now exists. It's part of dzDebugVisualizer and called "Universal Visualizer for Delphi". It has got a configuration page in the Tools -> Options … Continue reading Universal Debug Visualizer for Delphi

Simplified Debug Visualizers for all my TNullableTypes

After playing around with debug visualizers, I found that there is a very simple way to provide a visualiser for many record types: Just add a special method (I called it Dump) to those records that returns a string that you can then evaluate in the debugger and display in the debug windows. There are … Continue reading Simplified Debug Visualizers for all my TNullableTypes

Getting the current line number in Delphi

Note to self: There is an easy way to get the current line number in Delphi, using the following function and JclDebug: [delphi] function GetCurrentLineNumber: Integer; var ModInfo: TJclLocationInfo; begin ModInfo := GetLocationInfo(ReturnAddress); Result := ModInfo.LineNumber; end; [/delphi] ReturnAddress is a compiler magic function in the system unit, introduced with Delphi XE2. TJclLocationInfo and GetLocationInfo … Continue reading Getting the current line number in Delphi

In recent Delphi you cannot rely on dividing by zero to raise an exception

This is mostly a note to self: Having been stuck with Delphi 2007 for many years I didn't notice that dividing floating point values by zero no longer raises an exception in recent Delphi versions. Apparently this changed around the time of Delphi 10.1, even though I found a blog post by Dalija Prasnikar saying … Continue reading In recent Delphi you cannot rely on dividing by zero to raise an exception