Even when the Delphi team was large, the documentation was lacking, so with the reduced Delphi team size, I don’t have high expectations of the below to get fixed.
But since much of the post Delphi 7 run-time library looks a lot like the .NET core, you can usually fallback to the Microsoft documentation.
I knew that methods on interfaces were not compatible with the procedure of object (like [WayBack] TProc)or function of object construct, but they are also not compatible with the reference to procedure or reference to function construct.
It’s not nearly as good as the one by Uwe Raabe, but I didn’t really update this code for about a decade as it has functioned well for me in the current state: in 2009 it was like [WayBack] bo library – Source Code.
A couple of years ago I wrote a two-part article about a dataset enumerator: A Magical Gathering – Part 1 and Part 2. Well, things evolved a bit since then and I wondered how one would implement something similar given the current features of Delphi. Actually I am following here a suggestion from commenter Alan Clark.
So for now it’s just to document that my enumerator is there and that it works as intended.
constructor Create(const Values: array of string);
It seems to be in QC.
The reason is not obvious until you realise (thanks Stefan for wording that) that attribute constructor arguments are limited to anything that can be const. Open arrays nor dynamic arrays can be const (yes, nowadays you can have “consts” that are dynamic arrays but in fact they are compiler protected variables).
An alternative you might think works, but fails us using one attribute per enumeration element. But that’s where Delphi RTTI leaves you in the dark: it does not expose the RTTI for enumeration elements (likely doesn’t even generate it), only the the enumeration type itself.
Recently I had to play some notification sounds in a Windows Delphi application where the application deployment should be as easy as possible: preferable copying the EXE around.
The thing that more recent Delphi versions made a lot easier is embedding WAV files as WAVE resources, more on that further on. Read the rest of this entry »
By default the compiler will emit warnings like these for projects when using either of the Delphi.Mocks.Behavior or Delphi.Mocks.Expectation directly or indirectly:
[dcc32 Warning] W1029 Duplicate constructor 'TExpectation.CreateOnceWhen' with identical parameters will be inacessible from C++
adding {$WARN DUPLICATE_CTOR_DTOR OFF} anywhere to your .dpr project file
modifying the the Project Options for your project (easiest is in the All configurations - All platforms target):
follow the path Delphi Compiler, Hints and Warnings in the treeview on the left
expand the Output warnings node in the listview on the right
set Duplicate constructor/destructor with identical parameters will be inacessible from C++ to Error
A screenshot of the second option is below.
Note that the spelling mistake in Duplicate constructor/destructor with identical parameters will be inacessible from C++ is how it is in the IDE, but that as Google search string it will give limited results, so here are some back-ground references:
This is about a web game focussing on the concurrency issues in multi-threading environments. By the conference there will be a Delphi version of it. At the workshop we will play each round interactively: all attendees play the round followed by a short discussion. This is about collective learning, so the speakers will probably learn… Read More