DFM files are not standard text files. 

In your BIN folder you will find a program CONVERT.EXE. 

To be able to read the DFM file as a standard text file you need to first run 
CONVERT.EXE passing it the DFM filename as the first parameter in the command line and 
the name of the output TXT file you require as the second parameter. 

You can then work on the file as a standard text file and make whatever changes you 
require, when you want to change back to a DFM file you again run CONVERT.EXE this 
time with the TXT as the first parameter and DFM as the second parameter.

Before any changes will be reflected in your application you will need to recompile 
your application.

It is possible to automate the entire process in code, even to the extent of 
recompiling if you wish, I have code in a D1 application which does exactly this, 
contact me privately if you require details.

Regards
Steve Galyer

[EMAIL PROTECTED]


----------
From:   Steven Wild[SMTP:[EMAIL PROTECTED]]
Sent:   Friday, 30 April 1999 12:18
To:     Multiple recipients of list delphi
Subject:        [DUG]:  Reading dfm files

I have a need to be able to read in a dfm, alter it,  and write 
it back to the  dfm file from within another Delphi app.

Does anyone have some code that will read a dfm into ledgeable 
form...  into a TstringList would be very helpful ...  and then 
write the altered one back out to file.

Why???  Well I want to be able to test and set a value on about 1000 
instances of a small group of components where they are used.  Rather 
than open all forms in the project and manually look for each 
possible instance of the components, I want to just be able 
to automate the process.  I just thought that automating processes is 
what we are all about so why not do it to dfms as well!

Steven Wild
Wild Software Ltd
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz


application/ms-tnef

Reply via email to