Solved

DFM <----> Text File

Posted on 1998-12-10
4
532 Views
Last Modified: 2010-04-04
Hi All !!!

Please, is here nay way to comvert DFM file to Text file or 'enum' DFM file in runtime ?

Thanx !

Ps: something line View As Form (alt F12) in Delphi...
0
Comment
Question by:rayofunreal
  • 2
4 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 1350303
HI Ray,

Link in the FMXUtils unit in your Delphi/Demos/Doc/FilManex.
Then try this

procedure TForm1.Button1Click(Sender: TObject);
begin
  ExecuteFile('convert.exe', 'unit2.dfm unit2.txt', 'c:\Program Files\Borland\Delphi 3\Bin', SW_SHOW);
end;

Should work the other way around too(just unit2.text ubit2.dfm in the params)

PS. SW_Show can be SW_HIDE.
Hope this helps
br(UINT)je.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1350304
I don't need to RUN external program....

I need some like this:

DFM2TXT('c:\proj.dfm',Memo1.Text);

is it possible with example you wrote ?
0
 
LVL 10

Accepted Solution

by:
Jacco earned 80 total points
ID: 1350305
This should work!

procedure DfmToText(InName: String; OutName: String);
var
  InStream: TFileStream;
  OutStream: TFileStream;
begin
  InStream:=TFileStream.Create(InName,fmOpenRead);
  OutStream:=TFileStream.Create(OutName,fmCreate);
  ObjectResourceToText(InStream,OutStream);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  DfmToText('c:\Test.dfm','c:\Test.txt');
end;

Regards Jacco.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1350306
I'll try it ! thanx !
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now