Porting to Delphi XE2: Delphi XE2 Unit scope names not always right
Posted by jpluimers on 2013/03/21
Sometimes, Delphi XE2 gets confused after converting an old Delphi project because the Unit scope names are not correct. When creating a new Delphi XE2 application, the Unit scope names are as follows:
- System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell
This means that if you don’t prepend a unit with a Unit scope prefix, Delphi will automatically try the list above. The thing is: when importing a Delphi project from an old Delphi version, the Unit scope names are somehow “guessed”, and not always complete:
- System;Xml;Data;Datasnap;Web;Soap;Winapi
This means it cannot resolve the right name for the VCL units like Controls or Forms, and you get a nice compiler error: But with the default, it cannot resolve the Windows and other units in the Winapi scope. So the list I normally use is one of these:
- System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;Winapi;System.Win
- System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;Winapi;System.Win;Bde
(Yes, some apps still store Paradox data locally and use the BDE)
–jeroen
ObjectMethodology.com said
Come on now. Are you sure some apps still store local data using the BDE?
Actually, local db data is *sure* to be making a come back. We have such large volumes of data now. It will take more than just a simple *single* data file approach to provide customers with the client side features that they want.
jpluimers said
I am. Corporate environment. The kind that is eras behind. So far, that the software now starts to be modern again (: