2
votes

Delphi is a great IDE and compiler. But sometimes it also has a few minor flaws. Like my problem right now...
I am working on a project that's created in Delphi 2007. But I like to use Delphi XE simply because the IDE has some interesting features and it happens to be more stable on my computer. So I opened the project in Delphi XE and have been changing the code, with backwards-compatibility in mind.
When I save the project again to open it in D2007, it has problems reading the project, though. The dproj file of XE is not compatible with 2007. To open the project in D2007 again, I need to delete the dproj file and open the dpr file. (Or I need to save the old proj file of 2007 and put it back again when I want to use D2007 again.)

This is annoying. Does anyone know a better solution to keep the right dproj file for each version?

3
And you probably wonder: I use D2007 at work and D-XE at home. When I work at home for my employer I can also use D2007 at home, but the IDE tends to crash a lot. D-XE is more reliable for me.Wim ten Brink
Apart from what Skamradt writes, be prepared for surprises when Delphi XE starts saving your files in Unicode and Delphi 2007 cannot read them. This apart from new components and properties that have been introduced in Delphi 2009 and up (yes, you can try to ignore those new properties in Delphi 2007, but you need to check carefully if you are not loosing any information because of that).Jeroen Wiert Pluimers
Fortunately, I'm not using any forms or components in this project. I'm working on non-visual background tasks and classes. When it works, it can be integrated in a D2007 forms application but for now it's a simple console application. I tend to create a lot of classes and projects this way, since other team members are doing the GUI part for me. :-)Wim ten Brink

3 Answers

3
votes

You can have your project in version control like Subversion. If you omit the .dproj files from version control, it is usually quite manageable to work in different versions of Delphi

8
votes

One thing you could do would be to place the DPR and DPROJ files in separate directories. Unfortunately you would have to merge any changes you make in one version to the other, but that is fairly simple using Beyond compare:

BCompare.exe .\d2007\project.dpr .\dXE\project.dpr

1
votes

I'm using single .dpr and multiple .dproj files in such case.

Basic steps: - Create project in D2007. - Close project. - Copy project.dproj to project.xe.dproj. - Open project.xe.dproj in XE. - Let it upgrade the project, save it and overwrite old project.xe.dproj. - Delete backup copy of project.xe.dproj created during the upgrade.

Now you have project.dproj to use in D2007 and project.xe.dproj to use in XE. Both are using the same codebase - project.dpr.