In the olden days[tm] there was a project for maintaining a Delphiversions.inc file which created human readable conditional defines from the VERxx conditional defines of the Delphi compilers. Since it seems to have vanished from the face of the Internet[tm], I have just added a new page to the Delphi Wiki which you can just … Continue reading Delphiversions.inc
Author: dummzeuch
Displaying a multi line error message without wasting space
I have got a form that usually displays outputs from various sources, each of which has a frame for its own purpose. Now, if an error occurs with any of theses sources, I want to display that error message on the bottom of the form, just above the panel that contains the action buttons. It … Continue reading Displaying a multi line error message without wasting space
Adding fields to a TDataset in code
The Delphi IDE allows you to add fields to a TDataset (descendant e.g. TTable, TQuery, TAdoTable etc.) by right clicking on the component and selecting "Add Field" or "New Field". For a particular project I didn't want to do that because I kept changing the query for which I want to add the fields. But … Continue reading Adding fields to a TDataset in code
GORM experimental release
GORM is an editor for .po files (in case that link is dead, see the Internet Archive) that was originally written by Lars Dybdahl and to which I have been contributing quite a few features in recent years. Since Lars is too busy to do a release and currently even the original download doesn't seem … Continue reading GORM experimental release
Comparing Variants
I hate Variants, did I say that before? They just make everything more complex than necessary. Did you ever try to compare two variants? E.g. you have got one that contains an empty string ('') and another that contains a date. Now you want to know whether they are equal or not. Simple? v1 := … Continue reading Comparing Variants
Comparing INI files
INI files are a simple but powerful means of storing a program's configuration. They have existed since the 16 bit Windows times, where they were stored in the Windows directory, later on they were stored in the program's executable directory and nowadays they usually go somewhere into a user's home directory. Microsoft has tried to … Continue reading Comparing INI files
Setting the caret in a TMemo
Once in a while you want to set the caret position (aka cursor position) in a TMemo to a given line and character in that line. If you google for it you will find lots of hits that tell you to do the following: With Memo1 do SelStart := Perform(EM_LINEINDEX, Line, 0); or without the … Continue reading Setting the caret in a TMemo
Weak references – or why you should enable ReportMemoryLeaksOnShutdown
I was enhancing my dzMdbViewer tool with a view that shows the table structure rather than the data of the table, when I out of curiosity added ReportMemoryLeaksOnShutdown := True; to the source code. I found some memory leaks that were easy to fix (and which I would probably have fixed anyway later when reviewing … Continue reading Weak references – or why you should enable ReportMemoryLeaksOnShutdown
Delphi7Help4BDS revisited
Today I updated the Delphi Help Expert (formerly called Delphi 7 Help for BDS) I wrote back then when Delphi 2005 came out and Borland managed to turn the online help into a mess (again). It now supports Delphi 2005 to XE6 and allows to reconfigure F1 + any of the modifier keys Shift, Ctrl, … Continue reading Delphi7Help4BDS revisited
Adding remote repositories to your mercurial.ini
Among a lot of other things you can add names for remote repositories to your mercurial.ini so you can access them without having to type that long path. This can be quite convenient e.g. [path] dzlib=ssh://twm@hg.code.sf.net/p/dzlib/hgdzmaincode allows me to clone a copy of my dzlib+tools main repository on sourceforge like this: hg clone dzlib dzlib+tools … Continue reading Adding remote repositories to your mercurial.ini