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
Category: Delphi
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
AutoComplete for TEdits
I am sure you know about the useful controls TJvDirectoryEdit and TJvFilenameEdit from the JVCL. They come in handy whenever you need an edit field that should allow autocomplete for file or directory names. It always irked me that I had to include not only the JVCL but also the JCL in order to just … Continue reading AutoComplete for TEdits
TStringList.CaseSensitive
Did you know that TStringList has got a property called CaseSensitive? It's no surprise that it is used when comparing the strings while sorting. But did you know that it defaults to FALSE? WTF? (This is Delphi 2007.)
When TAB jumps to the next row
I just stumbled over an oddity in TJvDbGrid (which probably also applies to the standard Delphi TDbGrid): Including dgTab in the grid's Options resulted in TAB moving the cursor to the next row rather than to the next column as expected. It turns out, that this is due to the (protected) property TabStops which for … Continue reading When TAB jumps to the next row