Recent

Author Topic: Tools -> Delphi Conversion  (Read 6438 times)

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Tools -> Delphi Conversion
« on: January 03, 2019, 10:38:39 pm »
I'm trying Lazarus 2 RC3 on Win10 and hoping to keep learning more!

I'm trying to convert this old program: http://ctrlterm.com/CtrlTerm-Delphi-122513.zip but having problems.

After selecting Delphi Conversion on the Tools Menu, I select Convert Delphi Project to Lazarus Project and select the CtrlTerm.dpr file, then I uncheck all of the options and click Start Conversion then get:

AutomaticConversion.log
 Progress: Found all unit files
 Progress: Conversion took: 00:00:01
 Fatal: Conversion Aborted.

Why the Fatal?

After adding the unit Interfaces to the LPR file uses, the program compiles and runs okay.
« Last Edit: January 03, 2019, 10:50:48 pm by Paul Breneman »
Regards,
Paul Breneman
www.ControlPascal.com

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Tools -> Delphi Conversion
« Reply #1 on: January 03, 2019, 10:53:38 pm »
Same here (trunk).
The logfile is of no help.

Please file a bugreport and attach the zip to the bugreport.

Bart

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #2 on: January 03, 2019, 11:38:40 pm »
I'll file a bug report ASAP.  This page https://bugs.freepascal.org/login_page.php says:

Do you already have a login at Free Pascal Community? You can use that login here (use your e-mail address as username).

Free Pascal Community links here (doesn't work): http://community.freepascal.org:10000/

What is the Free Pascal Community?  Is that the same as this Lazarus forum?
Regards,
Paul Breneman
www.ControlPascal.com

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Tools -> Delphi Conversion
« Reply #3 on: January 04, 2019, 12:00:26 am »
AFAIK the community does not exist anymore.

Bart

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Tools -> Delphi Conversion
« Reply #4 on: January 04, 2019, 12:13:16 am »
What is the Free Pascal Community?  Is that the same as this Lazarus forum?
I can't remember how I created that account. But I have the same password for the bugtracker as for the forum.

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #5 on: January 04, 2019, 12:14:52 am »
AFAIK the community does not exist anymore.

I'll try to file a bug report on the bugs page.  :)
Regards,
Paul Breneman
www.ControlPascal.com

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #6 on: January 04, 2019, 12:06:31 pm »
As I wrote earlier, the program compiles and runs okay.  I'll try to file two bug reports soon.

When I open the CtrlTerm.lpr file, why is Product -> Forms (View Project Forms) empty?  Isn't the LPR file enough (similar to the DPR file in Delphi)?
Regards,
Paul Breneman
www.ControlPascal.com

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Tools -> Delphi Conversion
« Reply #7 on: January 04, 2019, 12:52:27 pm »
Isn't the LPR file enough (similar to the DPR file in Delphi)?

AFAIK, in Lazarus all that information is stored in the LPI; the LPR is just the main program source.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #8 on: January 04, 2019, 02:48:18 pm »
Isn't the LPR file enough (similar to the DPR file in Delphi)?

AFAIK, in Lazarus all that information is stored in the LPI; the LPR is just the main program source.

I guess that the LPI stores additional information, but why is it necessary?  The LPR has enough to list the project forms.
Regards,
Paul Breneman
www.ControlPascal.com

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #9 on: January 04, 2019, 02:55:55 pm »
I'll try to file two bug reports soon.

Here they are (2 of 5 reports):
https://bugs.freepascal.org/view.php?id=34814 - bugs web page fixed
https://bugs.freepascal.org/view.php?id=34810 - Conversion fault
Regards,
Paul Breneman
www.ControlPascal.com

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Tools -> Delphi Conversion
« Reply #10 on: January 04, 2019, 03:16:47 pm »
I guess that the LPI stores additional information, but why is it necessary?  The LPR has enough to list the project forms.

Normally yes, from the uses clause, but not neccesarily: you can make a LPR file which "uses" only the strictly needed units--p.e. just the main form--for the main program to compile, so all the information needed to build the project is stored in the LPI. For example, part of the LPI from one of my (console) projects:

Code: XML  [Select][+][-]
  1.   <ProjectOptions>
  2.     <Units Count="1">
  3.       <Unit0>
  4.         <Filename Value="buildiff.pas"/>
  5.         <IsPartOfProject Value="True"/>
  6.       </Unit0>
  7.     </Units>
  8.   </ProjectOptions>

And a snip from a GUI one (a form unit):
Code: XML  [Select][+][-]
  1.       <Unit1>
  2.         <Filename Value="fmain.pas"/>
  3.         <IsPartOfProject Value="True"/>
  4.         <ComponentName Value="Main"/>
  5.         <HasResources Value="True"/>
  6.         <ResourceBaseClass Value="Form"/>
  7.       </Unit1>

The LPR is just pascal source; the extension is mostly a convenient way to find quickly where the "program Whatever;" statement resides.
« Last Edit: January 04, 2019, 03:22:09 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Tools -> Delphi Conversion
« Reply #11 on: January 04, 2019, 03:28:15 pm »
When I open the CtrlTerm.lpr file, why is Product -> Forms (View Project Forms) empty? 
Maybe, because the conversion aborted due to the error that you report, the lpi file was not written? Simply you could add the main form unit to the project manually, as well as all required packages (if they are missing, too).

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Tools -> Delphi Conversion
« Reply #12 on: January 04, 2019, 03:51:09 pm »
When I open the CtrlTerm.lpr file, why is Product -> Forms (View Project Forms) empty? 
Maybe, because the conversion aborted due to the error that you report, the lpi file was not written? Simply you could add the main form unit to the project manually, as well as all required packages (if they are missing, too).

Do note that opening an LPR is like opening any other Pascal source, wheter .PP, .PAS, .P or whatever except it first shows the warning shown in the atttached image (ETA: if the corresponding LPI exists).
To open the project one has to open the .LPI file.
« Last Edit: January 04, 2019, 04:03:06 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Tools -> Delphi Conversion
« Reply #13 on: January 04, 2019, 05:19:09 pm »
When I open the CtrlTerm.lpr file, why is Product -> Forms (View Project Forms) empty? 
Maybe, because the conversion aborted due to the error that you report, the lpi file was not written? Simply you could add the main form unit to the project manually, as well as all required packages (if they are missing, too).

The conversion only takes one to four seconds (please try it, the zip is only 137KB).  There are LPI and LPS files created, but apparently something is missing in them.  Those files look much more complex than the LPR file, so I'll probably hold off on trying to figure things out for myself.

Thanks for all of the feedback in this message thread!
Regards,
Paul Breneman
www.ControlPascal.com

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Tools -> Delphi Conversion
« Reply #14 on: January 04, 2019, 06:53:44 pm »
[...]  I uncheck all of the options and click Start Conversion [...]
I keep all options untouched, start the conversion, and the lpi file is created correctly with the mainform is included. There are a few problems, though:
  • As you already noted, the unit "Interfaces" is not added - but this is a single click.
  • The coordinate offsets are not applied to the ConnectGroupbox although this was activated in the conversion form; this means the controls contained in the groupbox have a too large Top value.

 

TinyPortal © 2005-2018