Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting delphi to load DFM's in text form

401 views
Skip to first unread message

Wayne Louis Schroder

unread,
Apr 26, 1996, 3:00:00 AM4/26/96
to

re trying to port a DOS app (~1000 screens) to Delphi.
I have written a tool which converts our screens into a DFM
format (what you see when you right-click on a form and
select "View as Text"). Here's the problem: Delphi will not
load a file (DFM) that is in straight text format (it apparently
expects DFM's to be in a binary format.) How can I get
Delphi to load this textual file definition? Delphi obviously
knows how to do the conversion, because it does it every time you
hit Alt-F12 on a form, but how can it load from file?

Any help would be greatly appng
Wayne Schroder
wsch...@softsens.usa.com


Reid Abel

unread,
Apr 27, 1996, 3:00:00 AM4/27/96
to

Wayne Louis Schroder wrote:
>re trying to port a DOS app (~1000 screens) to Delphi.
>I have written a tool which converts our screens into a DFM
>format (what you see when you right-click on a form and
>select "View as Text"). Here's the problem: Delphi will not
>load a file (DFM) that is in straight text format (it apparently
>expects DFM's to be in a binary format.) How can I get
>Delphi to load this textual file definition? Delphi obviously
>knows how to do the conversion, because it does it every time you
>hit Alt-F12 on a form, but how can it load from file?


This is off the top of my head, so here goes:

- create a new, blank form in Delphi
- in Notepad, open your DFM-style text and copy it all to the clipboard
- Go to the blank Delphi form and use Paste

I haven't done this in a while, but I believe that when you paste it onto the form,
Delphi will do the conversion to controls from text automatically.

If it doesn't work smoothly right away, try some simple text chunks first, or try
copying the textual version of a test control, saving it to file, modifying it, then
do the cut and paste thing again.

Reid Abel


Rich Mulvey

unread,
Apr 29, 1996, 3:00:00 AM4/29/96
to

On 27 Apr 1996 18:40:03 GMT, Reid Abel <re...@ares.ubc.ca> wrote:

>Wayne Louis Schroder wrote:
>>select "View as Text").
>>Here's the problem: Delphi will not
>>load a file (DFM) that is in straight text format (it apparently
>>expects DFM's to be in a binary format.) How can I get
>>Delphi to load this textual file definition?
>
>This is off the top of my head, so here goes:
>
>- create a new, blank form in Delphi
>- in Notepad, open your DFM-style text and copy it all to the clipboard
>- Go to the blank Delphi form and use Paste

There's an example program that converts forms from .DFM to .TXT and
back available in "Lloyd's Help file", which is available at various
web sites, including Borland's Delphi home pages and the Delphi
Information Connection (http://www.delphi32.com/html/dtips.html).

Katy

--
Katy or Rich Mulvey
mul...@vivanet.com <== Please use this address.

Phoenix Business Enterprises

unread,
Apr 29, 1996, 3:00:00 AM4/29/96
to

>expects DFM's to be in a binary format.) How can I get
>Delphi to load this textual file definition? Delphi obviously
>knows how to do the conversion, because it does it every time you
>hit Alt-F12 on a form, but how can it load from file?

Cut, paste, then F-12.

_
******************************************************************
NOTE: This software is currently in early alpha. If you notice any
problems, or RFC non-compliance, please report it to p...@pobox.com
-Please do not report duplicates, as this is usually a manual resend
-Still working on the references problem......It WILL get fixed
+------------------------------------------------------------+
|Chad Z. Hower - pho...@pobox.com |
|Phoenix Business Enterprises - p...@pobox.com - www.pbe.com |
|Physically in Church Hill, TN - Logically Not Sure |
+------------------------------------------------------------+
>>SQUID - The ultimate 95/NT offline databasing reader
**Special Compile: 3.000A (Alpha)

Brian C. Layman

unread,
May 2, 1996, 3:00:00 AM5/2/96
to

In article <4lr0jl$a...@acmey.gatech.edu>, gt6...@prism.gatech.edu (Wayne Louis Schroder) wrote:
>re trying to port a DOS app (~1000 screens) to Delphi.
>I have written a tool which converts our screens into a DFM
>format (what you see when you right-click on a form and
>select "View as Text"). Here's the problem: Delphi will not
>load a file (DFM) that is in straight text format (it apparently
>expects DFM's to be in a binary format.) How can I get
>Delphi to load this textual file definition? Delphi obviously
>knows how to do the conversion, because it does it every time you
>hit Alt-F12 on a form, but how can it load from file?
>
>Any help would be greatly appng
>Wayne Schroder
>wsch...@softsens.usa.com
>
create an empty form. Put the Text DFM in the clipboard and paste them onto
the form. This will work the other way (ie copy a component to note pad) too.


Brian Layman
BLa...@Bware.com

Jon Thompson

unread,
May 3, 1996, 3:00:00 AM5/3/96
to

In article: <4mbgje$1...@dns.pulsenet.com> bla...@b-ware.com (Brian C. Layman) writes:
> >re trying to port a DOS app (~1000 screens) to Delphi.
> >I have written a tool which converts our screens into a DFM
> >format (what you see when you right-click on a form and
> >select "View as Text"). Here's the problem: Delphi will not
> >load a file (DFM) that is in straight text format (it apparently
> >expects DFM's to be in a binary format.) How can I get
> >Delphi to load this textual file definition? Delphi obviously
> >knows how to do the conversion, because it does it every time you
> >hit Alt-F12 on a form, but how can it load from file?
> >
> >Any help would be greatly appng
> >Wayne Schroder
> >wsch...@softsens.usa.com
> >
> create an empty form. Put the Text DFM in the clipboard and paste them onto
> the form. This will work the other way (ie copy a component to note pad) too.
>
>

There should be a DOS Command line utility CONVERT.EXE in the Delphi BIN directory
that does the conversion between TXT and DFM (in either direction). You could write
a batch file using this to convert all the forms you want before loading them into Delphi.

--
Jon Thompson


0 new messages