Tag: delphi

Strings in Delphi (continued)

No Picture

It seems the more you look, the more you find. There are a few interesting points in how strings are handled in Delphi; I’ve talked before about the particularities of String type in Delphi, so I’ll not touch…

Read More »

The Lock keyword

No Picture

What I miss the most from C# is the lock keyword. Unfortunately Delphi doesn’t (yet) have such a “feature” so we’re stuck making calls to synchronization objects manually. It’s not a big problem actually but can get quite…

Read More »

Delphi “Future”

No Picture

The title is probably a bit misleading. I’m not going to talk about the “future of Delphi” rather about the concept of “future evaluation” in Delphi. You might have heard about the Delphi Prism product that Embarcadero/CodeGear is…

Read More »

String reverse tests

No Picture

This post will be a short one. Just giving a general recommendation for people doing String processing in Delphi – use PChar or ^Char for that. I have made a simple test program that reverses a very big…

Read More »

Strings, PChars and reference counting

No Picture

Hi folks, in today’s post I will continue with reference counting specifics of Delphi in the particular case of Strings. We’ll start with a small example: What will the output of this program be? The obvious result (the…

Read More »

C++ Builder TypeInfo alternative.

No Picture

I bet most Delphi developers know about TypeInfo operator. It provides type information somehow similar to reflection in Java or .NET (of course a lot more limited). Take this simple example: It will simply write “Byte” on the…

Read More »

That stupid garbage collector

No Picture

I’ve heard this phrase a few times in regards to Delphi’s reference counting mechanics. Before continuing with this post please note — Delphi doesn’t have a Garbage Collector (as Java or .NET)! It uses Reference Counting as part…

Read More »

Delphi 2009: reference to

No Picture

It’s probably not news anymore but Delphi 2009 supports anonymous methods out of the box. To be able to support them, CodeGear developers added a new type of a “pointer to a method” called a managed method reference:…

Read More »

Generics.Defaults: Bug

No Picture

There is a bug in Generics.Defaults unit in Delphi 2009. If you read my previous post: Generic Defaults you should know already about the “3 bytes long” data types and how are those passed as const parameters to…

Read More »

Generic Defaults

No Picture

One important part of any generic collection classes are the “type support” functions. And what I mean are the functions specific to each type that perform: Comparison – will return a value indicating if A > B or…

Read More »