Dr.Bob Examines... #59: Delphi 2005
Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Dr.Bob's Delphi Notes Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
 Dr.Bob Examines... #59
See Also: other Dr.Bob Examines columns or Delphi articles

This article uses the official released version of Delphi 2005.

Borland Delphi 2005
In this paper, I will cover some of the new features in Delphi 2005, showing how to get the best out of Delphi 2005 right from the start. I'll also cover some "semi-documented" features.

What's New in Delphi 2005
First of all, I've written a technical white paper describing What's New in Delphi 2005 which is now published on the Borland Developer Network.
My 10 top reasons for upgrading to Delphi 2005 are as follows:

Compiler Version?
One of the questions I've received in the past few weeks is about the compiler version of Delphi, which can best be determined using the RTLVersion compiler define (which is 17 for Delphi 2005) as follows:

  program RTLVersionDemo;
  {$APPTYPE CONSOLE}
  begin
    {$IF RTLVersion=17}
      writeln('Delphi 2005 with RTLVersion',RTLVersion);
    {$ELSE}
    writeln('Not Delphi 2005, RTLVersion = ',RTLVersion);
    {$IFEND}
    readln;
  end.

Self-defined Regions?
Another questions concerns the use of self-defined collapsible regions, which is hardly documented in the on-line help. Fortunately, it's very easy: you can also define you own regions of code that can be folded, using special $REGION and $ENDREGION compiler directives, as follows:

  {$REGION 'My own managed source code'}
   ...
   ...
  {$ENDREGION}
The comment in the $REGION compiler directive not required, but will be placed in the folded code box, and helps you to identify the contents of the folded code.

Configurable Helpfiles?
Someone else asked about Delphi 2005 helpfiles: if you didn't install crystal reports and don't need it in the helpfile, then there is a way to eliminate it from the helpfile. See the C:\Program Files\Borland\BDS\3.0\Help\Common directory for the helpfiles. You may first have to uninstall the help using the following command:

  reghelp -7
and then edit the bds3.HxA file and remove the line with
  <AttVal Name="CrystalReports" Display="Yes" UIString="Crystal Reports" />
Optionally, you can also edit the bds3.HxT and standaloneCommon.xml file and remove the Crystal references (make a backup of all files, just in case!).
In standaloneCommon.xml, make sure to change the line
  <Filter Name="Delphi 2005, Indy, Rave, Crystal">"DocSet"="bds3" OR
    "DocSet"="indy" OR "DocSet"="rave" OR "DocSet"="CrystalReports"</Filter>
to
  <Filter Name="Delphi 2005, Indy, Rave">"DocSet"="bds3" OR
    "DocSet"="indy" OR "DocSet"="rave"</Filter>
After that, you can register the helpfiles again using
  reghelp 7
You can run reghelp on the commandline to get more information. The argument is made up of bits: 1 = common, 2 = .NET and 4 = Win32. So if you only want the .NET and Win32 material, then you can also call reghelp 6. A negative number uninstalls help. And you should first call "reghelp -7" before installing any portion of the help again.
After all this, if you start the help from Delphi again, it will first need to update (the index), but that's normal. It may take "several minutes" (but usually much less time).
All editing in help .xml files at your own risk (make a backup first just in case).

Delphi 2005 Project Upgrade Dialog
If you use the Project Upgrade Dialog to migrate existing .dpr projects to Delphi 2005 for either Win32 or .NET, then you may experience that Delphi 2005 hangs after you click on OK in the Project Upgrade dialog. The issue is reported to Borland, but in the meantime, I've found a good workaround: load a .pas or .dfm file just before you open up the .dpr file (the .dpr will result in the upgrade wizard being displayed). Opening a .pas/.dfm file will load a Delphi personality, so you can safely upgrade/migrate the project.
You can even close the .pas/.dfm file before you open the .dpr - it doesn't have to remain loaded (but it was only needed to load a Delphi personality - even if it isn't the same personality you want to migrate the project to).
As a consequence, upgrading projects when you have just been working on other Delphi projects (without closing and restarting the Delphi 2005 IDE) also works fine. You may only encounter the hang if you've just started the Delphi 2005 IDE (and then the aforementioned workaround will help you avoid it).

Delphi 2005 Chats on BDNRadio
There have been a number of public chats on BDNRadio which are now available for download. If you missed some, then make sure to attend future ones, as they offer a chance of asking questions to the R&D engineers that built the products.
The 24 Hours of Delphi was a great event, in which I also participated.

Delphi 2005 Tutorials
I have written six technical hands-on tutorials for Delphi 2005, which have finally been published on the Borland website. The following is a list of topics, including the links to the BDN website:

If you like these tutorials, then you should check out my courseware manuals (between 100-200 pages in PDF format).

Delphi 2005 Training Manuals
Several Delphi 2005 Courseware manuals (including Delphi 2005 Essentials, ASP.NET Web Forms, XML, SOAP and Web Services) are not only used in my training classes, but now also available for purchase using my ASP.NET electronic courseware on-line ordering application.
Each courseware manual can be used for a 3-day training course - either in workshop or self-study.

Advanced ASP.NET and Enterprise Core Objects II courseware manuals will be available for purchase later in 2005.


This webpage © 2004-2010 by Bob Swart (aka Dr.Bob - www.drbob42.com). All Rights Reserved.