Recent

Author Topic: Converting Delphi 2 project  (Read 7261 times)

andersos

  • New member
  • *
  • Posts: 9
Converting Delphi 2 project
« on: March 11, 2011, 11:42:45 am »
Hi all,

I want to move my Delphi 2 project to Lazarus and I tried converting it. Conversion stops with error in the dpr.
The error doesn't tell me anything. Please can someone help?

Here's the error :

Code: [Select]
*** Find all unit files... ***
---------------------------------------------
Bokfproj.dpr(17,4) Error: End of source not found
Conversion Aborted.

And here's the dpr :

Code: [Select]
program BokfProj;

uses
  Forms,
  Bokf in 'Bokf.pas' {HuvudForm},
  Samm in 'Samm.pas' {Sammandrag},
  VerList in 'VerList.pas' {VerLst};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(THuvudForm, HuvudForm);
  Application.CreateForm(TSammandrag, Sammandrag);
  Application.CreateForm(TVerLst, VerLst);
  Application.Run;
end.

Bart

  • Hero Member
  • *****
  • Posts: 5715
    • Bart en Mariska's Webstek
Re: Converting Delphi 2 project
« Reply #1 on: March 11, 2011, 02:31:17 pm »
Up to and including Delphi 3, the *.dfm (forms) are saved in a proprietary format.

When you rightclick on a form you can open the form as text.
If you save this text with the .lfm fileextension, you can probably import it in Lazarus (make a backup copy af the original *.lfm, otherwise Delphi 2 will be unable to read them in).

If right-clicking on the form does not give you the option to open the form as text, then you can programmatically convert *.lfm's to text.

I do not remember the syntaxt for it, but I have a D3 program that does exactly that (for D3 forms), so I can give you the source code for it (you can find it at: http://home.tiscali.nl/~knmg0017/software/D3DfmToText_bron.zip).

Bart

andersos

  • New member
  • *
  • Posts: 9
Re: Converting Delphi 2 project
« Reply #2 on: March 11, 2011, 03:16:55 pm »
Yes I know about the binary format dfm files but this error happens in the dpr file. It says on the developer blog that Lazarus conversion is able to handle
the binary dfm files too.  http://lazarus-dev.blogspot.com/2010/09/delphi-converter-improves.html

I installed Lazarus snapshot of yesterday.

Bart

  • Hero Member
  • *****
  • Posts: 5715
    • Bart en Mariska's Webstek
Re: Converting Delphi 2 project
« Reply #3 on: March 12, 2011, 01:10:23 pm »
Yes I know about the binary format dfm files but this error happens in the dpr file. It says on the developer blog that Lazarus conversion is able to handle
the binary dfm files too.  http://lazarus-dev.blogspot.com/2010/09/delphi-converter-improves.html

Cool, I hadn't noticed that.
I still have some D3 projects that I have to move to Lazarus (Lazarus is so much better then D3), so that's rather convenient.


If you remove all units with the exception of Forms from the uses clause in the *.dpr (just for testing purposes), do you then still get the same errormessage?


Bart
« Last Edit: March 12, 2011, 01:13:49 pm by Bart »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4715
  • I like bugs.
Re: Converting Delphi 2 project
« Reply #4 on: March 12, 2011, 08:29:19 pm »
Yes I know about the binary format dfm files but this error happens in the dpr file. It says on the developer blog that Lazarus conversion is able to handle
the binary dfm files too.  http://lazarus-dev.blogspot.com/2010/09/delphi-converter-improves.html

I installed Lazarus snapshot of yesterday.

Hi

Could you copy the project somewhere so I can take a look at it.
I haven't touched the converter for a while but surely it is not perfect yet.
Does the problem happen with many projects or just one?

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

andersos

  • New member
  • *
  • Posts: 9
Re: Converting Delphi 2 project
« Reply #5 on: March 14, 2011, 07:12:53 pm »
*Back from weekend*  ::)

This is the first project I try to convert. I'll try what Bart said and later upload the project somewhere.

 

TinyPortal © 2005-2018