Tag: rtl

Version 0.2.1 of HelperLib

No Picture

Just released the “fix” version for HelperLib: 0.2.1. Major highlights: Improved the performance for IntToStr functions for “big numbers”. (From 25 minutes to 17 seconds for a 256^10000 number). A BCD-izer algorithm was used to create a BCD…

Read More »

HelperLib 0.2 released!

No Picture

I have finally released the version 0.2 of the HelperLib library. If you’ are interested in using generics in your Delphi 2009 applications, you might actually be interested in taking a look at the library. What can you…

Read More »

Forcing RTTI on record types

No Picture

While developing the “Type Support” module for the generics library I’m working on I’ve encountered a little problem – the compiler will not emit RTTI information for the records. Actually that isn’t entirely true – RTTI will be…

Read More »

Pointer to String casts

No Picture

This post describes how to avoid a recent mistake I’ve seen in a Delphi application related to “Pointer to String” casting. Consider the following example: In this example an untyped pointer was allocated with 128 bytes of memory,…

Read More »

Delphi Prism: DelphiString

No Picture

Was just reading the source code for ShineOn (the RTL implementation in Delphi Prism) and found an interesting piece: DelphiString (in /ShineOn.RTL/DelphiString.pas). What is it? It is a class that tries to replicate the behavior of the Win32…

Read More »

Delphi and the Integer data types

No Picture

There’s a lot of discussions on CodeGear newsgroups lately regarding the Integer data types and 64 bit support. Just wanted to clarify some points for people waiting for the 64 bit release of RAD Studio (due somewhere in…

Read More »

Delphi Generics: constructor restriction

No Picture

As promised in the previous post “Delphi: Default parameterless constructor” I will now try to create a new generic class that accepts a type parameter that has a “constructor” restriction (must have a default public parameterless constructor). Let’s…

Read More »

Delphi: Default parameterless constructor

No Picture

A weird consequence of Delphi’s OOP behavior is how constructors are handled, and in particular how the default parameterless constructor is handled. Consider the following example: [Delphi] type TMyClass = class end; var Obj: TMyClass; begin Obj :=…

Read More »

Out vs Var parameters

No Picture

All Delphi developers obviously know about the var keyword, otherwise known as “by reference“. Some (although I doubt it) may not know that Delphi has an out keyword also. Both are identical in the fact that both are…

Read More »

String results and the weird stuff

No Picture

There is an interesting particularity to the Delphi compiler. It relates to Strings and Dynamic Arrays. Consider the following two routines: What is the difference between these two routines? Nothing except the syntax. In both cases Result is…

Read More »