Recent

Author Topic: Importing Delphi 2005 source into Lazarus  (Read 8910 times)

fozzedout

  • Newbie
  • Posts: 3
Importing Delphi 2005 source into Lazarus
« on: October 26, 2011, 03:01:15 pm »
I've inherited a project (oh joy...) that was written in Delphi 2005 that is now in need of some modifications, but without Delphi 2005 to actually code in. As such I'm taking this opportunity to breathe some life into this project with some open source goodness. (That and I'll be coding in Linux...)

So I figured that I'd best ask first, but is there a way to import Delphi 2005 projects into Lazarus, and if so, are there any caveats that I need to be aware of? (i.e. language differences, libraries, etc)

Just to point out as well, I haven't touched Pascal since Turbo Pascal 6 was the "big thing", so I have no concept of the state of Delphi or Lazarus. I always knew not keeping up with Pascal would catch up with me eventually...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4695
  • I like bugs.
Re: Importing Delphi 2005 source into Lazarus
« Reply #1 on: October 26, 2011, 04:11:36 pm »
Try the feature Tools -> Convert Delphi Project ...
Your success will depend on the code itself. Does it call WinAPI a lot? Does it use components or libraries not ported to Lazarus? Etc...

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

fozzedout

  • Newbie
  • Posts: 3
Re: Importing Delphi 2005 source into Lazarus
« Reply #2 on: October 26, 2011, 04:20:50 pm »
Thanks - I had hoped it would be that simple.

As far as the project goes... I don't know anything about it.

The whole project has been a bit of silence, and only today (over a month of requests - it started on the 21st of Sep!) has the original programmer reared his head and stated that it was written in Delphi 2005, and "shared" the source code... that we still can't access at the moment.

No matter, if bits are hardwired to windows (which I highly doubt), then I'll have to rewrite them - at least it'll be faster than rewriting a whole project - and that was my main worry!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4695
  • I like bugs.
Re: Importing Delphi 2005 source into Lazarus
« Reply #3 on: October 26, 2011, 07:19:16 pm »
Thanks - I had hoped it would be that simple.

I didn't say it is simple. It depends. This forum and the mailing list are very helpful. We might see more questions from you later.

Quote
As far as the project goes... I don't know anything about it.

The whole project has been a bit of silence, and only today (over a month of requests - it started on the 21st of Sep!) has the original programmer reared his head and stated that it was written in Delphi 2005, and "shared" the source code... that we still can't access at the moment.

No matter, if bits are hardwired to windows (which I highly doubt), then I'll have to rewrite them - at least it'll be faster than rewriting a whole project - and that was my main worry!

Sounds strange that someone told you to convert a project but didn't give its sources!

While waiting you can read what the converter does:
 http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus

This site has some small but "real" Delphi apps. Some of them convert fully automatically. You can warm up with them. :)
 http://delphiforfun.org/

One thing: the form file conversion is little broken in Lazarus trunk (development version) because of this:
 20308: Codetools CheckLFM reports many common types as "not found"
in case you wonder. If you use the release version it doesn't matter for you.

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

fozzedout

  • Newbie
  • Posts: 3
Re: Importing Delphi 2005 source into Lazarus
« Reply #4 on: October 26, 2011, 07:29:32 pm »
I didn't say it is simple. It depends. This forum and the mailing list are very helpful. We might see more questions from you later.
The fact that you have a method of doing the conversion job is a step in the right direction, though I think you are right. I will be asking questions. Lots of them! :)

Sounds strange that someone told you to convert a project but didn't give its sources!
Something about the author "discovering" god, and disavowing all earthly needs. Which includes work. But he did take his laptop (which had Delphi and the source code on it).

Not my place to judge, but that story seems a little off IMHO.

While waiting you can read what the converter does:
 http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus

This site has some small but "real" Delphi apps. Some of them convert fully automatically. You can warm up with them. :)
 http://delphiforfun.org/

One thing: the form file conversion is little broken in Lazarus trunk (development version) because of this:
 20308: Codetools CheckLFM reports many common types as "not found"
in case you wonder. If you use the release version it doesn't matter for you.
Thank you very much! I'm relearning Pascal from many years ago, so while I wait, this is perfect practice! :D

 

TinyPortal © 2005-2018