views:

161

answers:

3

We recently converted our long-running Delphi project to Open Source. Multiple people have contributed patches already, which is great, but unfortunately forms and frames when saved with Delphi 2006 (and later) contain new properties in the .dfm that are not handled by older versions. Forms are handled quite gracefully by the IDE ("ignore propery?"), but frames are loaded at runtime and result in errors. Not an option, as far as I'm concerned.

I now removed those properties from the .dmf files by hand, but I am really wondering if there is a more elegant solution. There is no way to save in a backwards compatible format from the new IDE's, is there? Are there existing tools to strip the nonsupported properties from the .dfm's ? Any other elegant solution I am missing?

Normally, with a commercial project, I'd just upgrade the project to the most recent version applicable... but as this is open source I really don't want to loose out on those developers still working on Delphi 7. That includes myself, actually.

+11  A: 

The JEDI JVCL project uses a little utility dc.exe (delphi cleaner) and a list of properties in DFMs that are not present in older versions of delphi, mine contains the following text:

*.PopupMode
*.PopupParent
*.ExplicitLeft
*.ExplicitTop
*.ExplicitWidth
*.ExplicitHeight
*.BevelKind
*.BufferDocument
*.DoubleBuffered
*.ParentDoubleBuffered
*.DisableHyperlinks
*.AlwaysEnquoteFloats
*.PixelsPerInch

I run this dc.exe utility from a batch file which cleans my dfms before I commit changes to subversion. The syntax in my batch file for this is:

dc.exe -s -fd10.txt *.dfm -i

You can grab my stuff at:

http://sites.google.com/site/warrenpostma/files
Warren P
You type waaay too fast. <g> I was almost all the way through posting the same info; you beat me to it.
Ken White
+3  A: 

Well, for sake of completeness:

Open the dfms in the oldest Delphi supported, let it remove all unknown properties, change a property and save.

For your purposes, Warren's solution is better, but it can be a workaround. I did it for a while when we were dual D7-D2006ing.

Marco van de Voort
+1 for the sake of completeness :-)
François
+4  A: 

You can try Andy's DFMCheck. It can automatically open and close all forms and frames in a project, which makes the IDE remove unknown properties (as Marco wrote).

Ulrich Gerhardt
Nice - I did not know about this. Thanks.
Warren P