Recent

Author Topic: using DFM in both Delphi and Lazarus  (Read 13776 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
using DFM in both Delphi and Lazarus
« on: September 20, 2016, 02:22:29 pm »
Hi all,

new thread about a well known building site..

Today I reopened a DFM in Delphi and Delphi complains
"EReadError .. Property doesn't exist" - It's 

Code: Pascal  [Select][+][-]
  1. LCLVersion = '1.6.0.4'
usually using latest Lazarus release version with Windows 10

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: using DFM in both Delphi and Lazarus
« Reply #1 on: September 20, 2016, 02:45:56 pm »
Just remove it by hand, of course Delphi has no idea at all about LCLVersion.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #2 on: September 20, 2016, 03:02:21 pm »
The new Lazarus-DFM is about 2 times larger than the original DFM.
That would be a lot of work. I simply recovered from backup.
usually using latest Lazarus release version with Windows 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: using DFM in both Delphi and Lazarus
« Reply #3 on: September 20, 2016, 03:25:56 pm »
Yes, using the same .dfm file between Delphi and Lazarus projects is problematic. That is why the Delphi converter in Lazarus creates a new .lfm file by default. A common .dfm file can be selected but it is useful only in some simple cases.
A downside of having separate .dfm and .lfm files is obviously that all layout changes must be done in 2 places.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #4 on: September 20, 2016, 04:09:15 pm »
A common .dfm file can be selected but it is useful only in some simple cases.
I can see no simple case.

From the moment when Lazarus writes
Code: Pascal  [Select][+][-]
  1. LCLVersion
into the DFM file, Delphi 5 fails to read.
usually using latest Lazarus release version with Windows 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: using DFM in both Delphi and Lazarus
« Reply #5 on: September 20, 2016, 04:37:16 pm »
I can see no simple case.
Yes, even the simple cases require some manual editing.
The recommended way is to use separate .dfm and .lfm files.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: using DFM in both Delphi and Lazarus
« Reply #6 on: September 20, 2016, 04:46:06 pm »
I can see no simple case.
Yes, even the simple cases require some manual editing.
The recommended way is to use separate .dfm and .lfm files.

I can say that this also goes between Delphi versions.
There is no 'one' Delphi version.
People leave that version they use out, most of the time.

You will run into those manual edits anyway.
Even just using Delphi.

I second your remark.
« Last Edit: September 20, 2016, 04:48:01 pm by Thaddy »
Specialize a type, not a var.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #7 on: September 20, 2016, 05:06:03 pm »
The recommended way is to use separate .dfm and .lfm files.
Not an easy thing to maintain, I have ~ 130 forms ..  :(
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: using DFM in both Delphi and Lazarus
« Reply #8 on: September 20, 2016, 05:29:11 pm »
I've never tried this, but seriously, is there really a way from Lazarus back to Delphi? Even the opposite direction, from Delphi to Lazarus, is already very difficult, and I always thought this would be a one-way stree.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #9 on: September 20, 2016, 05:49:54 pm »
I've never tried this, but seriously, is there really a way from Lazarus back to Delphi? Even the opposite direction, from Delphi to Lazarus, is already very difficult, and I always thought this would be a one-way stree.
Well, there's no way back, but ..
I currently maintain a large application running under both Delphi 5 and Lazarus 1.6
This works.
usually using latest Lazarus release version with Windows 10

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: using DFM in both Delphi and Lazarus
« Reply #10 on: September 20, 2016, 06:09:12 pm »
I've never tried this, but seriously, is there really a way from Lazarus back to Delphi? Even the opposite direction, from Delphi to Lazarus, is already very difficult, and I always thought this would be a one-way stree.
Maybe between Lazarus and Delphi GUI, but between FPC and Delphi non-gui its a no-brainer for non-gui applications (server software).
I maintain a lot of them in both worlds.
Specialize a type, not a var.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #11 on: September 20, 2016, 06:23:32 pm »
What's the difference ?
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: using DFM in both Delphi and Lazarus
« Reply #12 on: September 20, 2016, 06:34:33 pm »
I currently maintain a large application running under both Delphi 5 and Lazarus 1.6
This works.
What's the advantage of maintaining an application for two IDEs? Or is it that the Lazarus version does not support all features of the Delphi version?

Quote from: PeterX
What's the difference?
No forms, no lfm/dfm mess.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #13 on: September 20, 2016, 06:43:36 pm »
What's the advantage of maintaining an application for two IDEs? Or is it that the Lazarus version does not support all features of the Delphi version?

Well, I do this because there's a lot of differences between LCL and VCL.
So lots of things do still not work under the "Lazarus version" of the program.

One day I want to get rid of the ol' Delphi version, yes !
usually using latest Lazarus release version with Windows 10

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: using DFM in both Delphi and Lazarus
« Reply #14 on: September 20, 2016, 06:59:00 pm »
But then, why is it necessary to recompile the Lazarus project with Delphi?

 

TinyPortal © 2005-2018