Tag: LinkedIn
How To: Invokable Variants
In this post I will try to explain how to create a “late-bound” dictionary based on invokable variants. Most of the techniques related to the creation of a custom Variant data type are already described in How To:…
Read More »Little warning
If you’re ever going to write a custom invokable variant read the following, otherwise just skip this post. I will not detail on how to create a custom invokable variant type (that is a matter for another post),…
Read More »Array constructor
Speaking of features which are sparse in documentation. There is an intersting and a bit useless feature in dynamic arrays laying around: array constructors. Let’s check out this example: This code will actually compile and run. (May probably…
Read More »“in” is dead, long live “CharInSet” (or maybe not)
I’ve this question come up a few times, so … Since Delphi 2009 you have probably noticed this warning: “[DCC Warning] Unit1.pas(27): W1050 WideChar reduced to byte char in set expressions. Consider using ‘CharInSet’ function in ‘SysUtils’ unit.”…
Read More »Parameter checking
One of the worst parts of Delphi’s RTL is the fact that parameters are not being checked for correctness in a function call. What this means is that the offending routine will not function as intended in certain…
Read More »Generics + System.Move = Kaboom!
It’s probably not a news anymore that the Move method (in System unit) should not be used to move chunks of memory that contain references to managed type (like String, Interface of dynamic arrays). By moving only the…
Read More »How To: Creating a custom Variant type
In this post I will detail on how to create a custom Variant for your data type. First of all, the help should be pretty useful in this case, but it if doesn’t help much, there is always…
Read More »[Rant] Actions …
Just a few words out of frustration: Do yourselves a favor and stay away from actions and ribbons in Delphi. At least for a while. If you really need fancy looking menus use JEDI. P.S. This would be…
Read More »TDelegatedEqualityComparer
In this post I will try to exemplify the use of TDelegatedEqualityComparer class which can be found in Generics.Defaults unit in Delphi 2009. TDelegatedEqualityComparer is a simple class that requires two user provided routines at creation time. These…
Read More »Avoid using TDictionary
There are serious flaws in TDictionary in Delphi 2009. Try to avoid using it until a fixed version comes out. You can find a list of them in QC, but just to name two: TDictionary.Clear() is flawed. If…
Read More »