Does Delphi sometimes revert text form files (DFM) to binary format?
Asked Answered
L

7

12

Our Delphi 7 development team stores form files (dfm) in text mode, and uses a source control system (Subversion) to track changes.

Sometimes, we noticed that a form file returned to binary format between revisions, causing diff tools like TortoiseMerge to complain.

Using the Subversion change log, I can see that the DFM file was stored in text form before. The software developers never change the storage file format back to binary manually.

Have you encountered the same? Is it a known problem?

Lalo answered 9/5, 2009 at 7:41 Comment(2)
This is an old question, and this doesn't answer the question. However google showed me here so if this happens to somebody else I'd like to leave this here. Delphi has a conversion tool, and you run it like this to convert all dfm-files from binary to text: <path to delphi>\bin\convert.exe -i -s -t *.dfm. Those that are already text are left untouched.Dietary
That was indeed very helpful! I've never thought there are a solution for that lol! that's that worked like a charmCarreon
H
4

I have seen it happen in Delphi 7 when a form inheriting from another form from a different project was opened in Delphi on its own without the project it belongs to being open.

Harbison answered 9/5, 2009 at 15:33 Comment(0)
T
15

This does happen in Delphi 7 but is fixed in later versions. Usually you access forms in the IDE by opening the .pas file and then switching to the Form View. Right click your form and it will show that it is "Text DFM" ticked if you have done this before.

You will experience the problem you have described of a text DFM switching to a binary DFM when in the Delphi 7 IDE you open the .dfm file directly. eg. File->Open->Somefile.dfm .. Right click the dfm and choose "View as Form". Now right click the form, you will see that the "Text DFM" is unticked.

We were getting the problem when we opened up a DFM which was a grep search result. It had us perplexed also, and would cause corruption of the dfm in cvs as it was checked in as text.

Tadpole answered 20/10, 2010 at 3:47 Comment(0)
H
4

I have seen it happen in Delphi 7 when a form inheriting from another form from a different project was opened in Delphi on its own without the project it belongs to being open.

Harbison answered 9/5, 2009 at 15:33 Comment(0)
G
4

This sometimes happens when the IDE gets confused.

It usually starts after you got an access violation inside the Delphi 7 IDE.

Sometimes also one or mor of your Delphi editor buffers inside the IDE become readonly (while the files on disk are still read/write).

The behaviour occurs much less than in Delphi 5 or 6, but sometimes it does occur in Delphi 7.

The best thing you can do is restart the Delphi 7 IDE as soon as you get an access violation.

Gabriello answered 11/5, 2009 at 0:4 Comment(0)
C
2

If someone has opened the project with different version of Delphi (or changed the default settings), he may save the forms in different format.

Cobaltous answered 9/5, 2009 at 8:21 Comment(1)
Good hint, I will check this. We have also Delphi 2007 and 2009 installed. The default settings are only for new forms, so I am not sure how they can affect existing forms.Lalo
C
2

You may be interested in investigating the use of Beyond Compare instead of TortoiseSVN's built-in merge tool. Beyond Compare is written in Delphi, and natively knows how to read binary DFMs. This means that it then becomes less of an issue (or even no issue) whether your DFMs are stored in Subversion in binary or text. Beyond Compare V3 also does 3-way merging which makes it really easy to merge multiple commits etc. Even ignoring the ability to diff binary DFMs, it's still a much better diff viewer than TortoiseSVN's built-in tools. I can highly recommend it, and it's very inexpensive (I have no connection with Scooter Software, other than being a very happy customer).

Scooter Software

Crevasse answered 10/5, 2009 at 21:6 Comment(0)
S
1

We've certainly encountered this. We use D7 exclusively.

Never got to the bottom of it as it happens only half a dozen times a year or so, and although it's a nuisance it's fairly easily remedied.

I was interested to see Lars's answer, and will certainly look to see if that's a possible cause next time it happens.

Sugary answered 9/5, 2009 at 20:56 Comment(0)
F
1

We also have this issue from time to time, and it seems to be related to looking at the DFM's source (Alt-F12) and then doing a Visual Source Safe operation (e.g. check-in).

Fado answered 17/5, 2009 at 5:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.