Books : Mastering Borland Delphi 2005: Update for Delphi 2006

Mastering Delphi Update for Delphi 2006

Chapter 3

The Win32 Compiler in Delphi 2006

The Win32 compiler in Delphi 2006 has a number of interesting improvements, including some very interesting (and long awaited) ones. Moreover, some of the undocumented features in the Delphi 2005 compiler (that I described in “Mastering Borland Delphi 2005”) have been formally introduced and supported.

As this is a new version of the compiler (numbered 18.0), you might have to update your conditional compilation blocks, by using:


Another interesting feature, even if not commonly used, is that you can invoke the command line compiler with a new flag --no-config to disable the use of the default configuration file (dcc32.cfg).

Getting to the interesting new features, it is worth noticing that the aim is still to increase the degree of compatibility with the Delphi language .NET compiler. This aim is achieved by introducing class data (at last!), records with methods, and record operators overloading. As all of these features are discussed in Chapter 4 of the book, I'll delay the description of the equivalent Win32 capabilities until the “add-on” material for the next chapter.

Finally, notice the change from what I wrote in the section on “Inlining” in Chapter 3 of the book, in Delphi 2006 even compiler magic functions can now be inlined. These include the Length function, which is why the InliningTest example described in “Mastering Borland Delphi 2005” (which described how to write your own version of Length to optimize it) with the new version of Delphi becomes almost meaningless. This is in fact very good news, as Length is a very commonly used function and having it optimized certainly does help (even if you gain only a few microseconds for each call).