Recent

Author Topic: ct2laz - convertor between CodeTyphon and Lazarus  (Read 43830 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #30 on: January 24, 2018, 12:18:22 am »
Important changes since 1.2.0:

1.2.2.219 Fixed resource file handling (.lrs and .ctrs was missing in form edit box). Fixed output handling for new 7zip (added -bb1 switch which is not compatible with old 7zip v9.20 any more). Report error when old 7zip was found or when 7zip is not at expected location. Fixed disabling rename file edit boxes. Changed CSV boolean column values from 'T' and 'F' to more intuitive 'Y' and 'N'. These are breaking changes requiring you to delete old INI file and download new CSV file.

1.2.1.204 Fixed resource file renaming. Added more replacement pairs to CSV file.

https://bitbucket.org/avra/ct2laz/downloads/
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

AWilhelm

  • Newbie
  • Posts: 2
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #31 on: September 25, 2018, 12:49:28 pm »
I just converted my Project from CT to Lazarus, but when I compile the Project I get the Error-Message

Code: Pascal  [Select][+][-]
  1. win32int.pp(8,84) Fatal: Cannot find Win32Int used by Interfaces, incompatible ppu=C:\lazarus\lcl\units\x86_64-win64\win32\win32int.ppu, package LCL

Any idea how to solve this?

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #32 on: September 25, 2018, 05:57:08 pm »
...incompatible ppu...
usually means that you have left overs from another version of Lazarus or CT. Try to clean build all, or try to build with another version of Lazarus.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

witenite

  • New Member
  • *
  • Posts: 41
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #33 on: June 20, 2019, 09:26:26 am »
Hi Avra,
greetings from New Zealand. I downloaded and installed your ct2laz program and used it to convert a Lazarus project (demo source code from a 3rd party company) to CT. It practically worked "straight out the box". A very big thank you for your efforts in making this program, otherwise I was going to be up for many hours doing a manual conversion of questionable success.

Note I use Linux (Ubuntu 18.04) as my main workstation, so I was very pleased to see you have a Linux compiled option. Worked perfectly apart from the fact that it crashes right at the end with an error (Unable to create file "session.log"). Fortunately it does not appear to affect the actual conversion process. I've tried giving full read/write access rights to the install folder, but that hasn't helped, so I am not sure where it's trying to save the log file.

1 other thing to clarify: I see several times you mention that you MUST delete the ini file every time you do a conversion. Am I correct in thinking this is the ct2laz.ini file? Must this be deleted everytime before doing a conversion from Lazarus to CT or vice versa, or do you mean only whenever upgrading from one version to the next of ct2laz? It seems strange to need to delete an ini file for the program every time you use it to do a conversion.

Apart from these couple of very minor irritations, the programs is superb, thanks again for your efforts.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #34 on: June 21, 2019, 08:57:32 am »
Hello witenite,

Thank you for your kind words. I am always glad to hear that ct2laz helped someone.

Note I use Linux (Ubuntu 18.04) as my main workstation, so I was very pleased to see you have a Linux compiled option. Worked perfectly apart from the fact that it crashes right at the end with an error (Unable to create file "session.log"). Fortunately it does not appear to affect the actual conversion process. I've tried giving full read/write access rights to the install folder, but that hasn't helped, so I am not sure where it's trying to save the log file.
Could you please run it with sudo and report back if anything is different? If you do not trust executable, then you can build your own from the project. It should be easy since it does not use any 3rd party components.

1 other thing to clarify: I see several times you mention that you MUST delete the ini file every time you do a conversion. Am I correct in thinking this is the ct2laz.ini file? Must this be deleted everytime before doing a conversion from Lazarus to CT or vice versa, or do you mean only whenever upgrading from one version to the next of ct2laz? It seems strange to need to delete an ini file for the program every time you use it to do a conversion.
You only need to do it when you are upgrading an executable when something new is added to ct2laz.ini file structure. The reason for this behavior was to avoid complicated INI handling. I did not want to write code to detect missing INI items and then react. I simply used TIniPropStorage and let it do all the work. I will see if I can make it more clear and rephrase it to avoid further confusion.
« Last Edit: June 21, 2019, 09:02:14 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #35 on: November 15, 2020, 05:28:01 pm »
It's upgrade time. ct2laz has been updated to v1.4. It is now fully compatible with CT 7.2+. It is advised to delete your old INI file (if there is one) and download latest REPLACEMENTS.CSV file. As usual, CSV file and prebuilt Windows and Linux executables can be downloaded here:
https://bitbucket.org/avra/ct2laz/downloads/

1.4.0.230   Adapted download files naming to new CT 7.2+ 3 digit numeric increment multipart file extension for components and examples archives, so direct download from Pilot Logic site works again. Fixed INI storage to also save rename files checkbox status between sessions.
« Last Edit: November 15, 2020, 05:30:31 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #36 on: December 28, 2020, 04:53:09 pm »
Hi Avra,

Your conversion is not converting CodeTyphon TSQLQuery correctly, CT has an extra property 'Macros' which Lazarus has not.
See the attached error message after loading a converted CT project in Lazarus.
Otherwise your tool works flawless, it's a great help!
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #37 on: December 28, 2020, 05:20:06 pm »
Another missed property is "ShowMaximized" in the CT version of TfrReport which is not known in Lazarus.
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #38 on: December 29, 2020, 09:05:21 am »
Your conversion is not converting CodeTyphon TSQLQuery correctly, CT has an extra property 'Macros' which Lazarus has not.
CT uses trunk FPC and trunk LAZ. This usually means that there are changes which do not exist yet in official Lazarus, or fpcupdeluxe based one like fixes or some older version. Even 2 trunk versions which are few months apart may have huge differences in certain areas (be it in FPC or be it in LAZ).

Saying this, my guess would be that in particular cases you mentioned, TSQLQuery and TfrReport have moved forward in their trunk versions, and that such properties simply do not exist in LAZ/FPC combo you are using.

That is a never ending race, and ct2laz can not fix that and never will be able to do it. If those are properties stored on forms, your best bet would be to delete them in some external text editor and then try loading to older LAZ/FPC. If properties are in code, then for start simply comment them out, and then try to figure out if that was enough or not. If you have lots of forms having such properties, then you may want to extend replacements.csv with your own replacement pairs. It is a simple text replacement, but if you are in doubt ask here.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #39 on: December 29, 2020, 11:18:21 am »
Thanks Avra, I understand the continueous battle to keep ct2laz uptodate.
Your suggested solution is exactly what I did yesterday, I edited the lfm files with Notepad++ and after that the projected loaded and ran correctly in the latest stable  Lazarus version.
It just shows what a great help ct2laz is when using both CodeTyphon and Lazarus.
I use CodeTyphon mostly because I like its IDE more than the Lazarus one, it is just a pity that CodeTyphon is moving away further from standard Lazarus with each new release. But luckily then there is still ct2laz to keep the link between the two products alive.  ;D
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #40 on: December 29, 2020, 11:33:01 am »
Thank you for your kind words.

If you need to move the same project from CT to LAZ and vice versa over and over again, then I suggest to extend replacements.csv with your own replacement pairs. That would eliminate the need for external editor. Once you change version of CT or LAZ, you just need to test if your custom replacement pair is still needed.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

zeljkoc

  • Full Member
  • ***
  • Posts: 145
    • Zeljko Cvijanovic
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #41 on: December 29, 2020, 05:48:03 pm »
good work, my support

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #42 on: December 30, 2020, 08:03:56 am »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

kofccp

  • Newbie
  • Posts: 3
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #43 on: January 11, 2021, 02:54:56 pm »
I try to install unidac component on Codetyphoe7.2, that component has a lazarus package and I use CTCenter convert tool to convert it to CT package,when I installed the converted pacakage, I got the error message : DADesign.lrs(141,1) Error: Identifier not found "LazarusResources"

kofccp

  • Newbie
  • Posts: 3
Re: ct2laz - convertor between CodeTyphon and Lazarus
« Reply #44 on: January 11, 2021, 03:10:17 pm »
then I try ct2laz,The problem remains the same, can it be solved?

 

TinyPortal © 2005-2018