Tag: rtl

DeHL 2.2 Released

No Picture

In this release I have changed the name of the library from DelphiHelperLib to DeHL to be shorter. The most important changes in this release are: Renamed the library to DeHL in hopes to remove the length of…

Read More »

How To: Invokable Variants

No Picture

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

No Picture

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

No Picture

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)

No Picture

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

No Picture

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!

No Picture

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

No Picture

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 »

TDelegatedEqualityComparer

No Picture

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

No Picture

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 »