[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

DFM <----> Text File

Posted on 1998-12-10
4
Medium Priority
?
542 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 320 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 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