Resolved: Crazy issues on project migrated from delphi

Just started with WebCore VSC, and want to share this because it solved a week worth of headaches. Maybe someone finds it useful.
I have a number of WebCore apps made with delphi. They have grown but I can not deploy them because of my Delphi CE licensing. In addition my customer use Macs only, not Windows. So the ideal solution was Webcore with Lazarus, but I could never make it work.
Long story short, I finally got WebcoreVSC some weeks ago, and it indeed does work perfectly on Mac and Windows, so now I will start actually working with it, BUT I have the working apps from Delphi and I don't want to start over, so I gave a shot to just using the same code on Visual Studio Code.

The procedure was to create a new location folder for each project, copy all files, delete the temporary delphi files and just open the folder in VSC. They somehow kind of build and run UNTIL I actually open a unit/form on the form designer, then all weird problems start showing:

  • Components renamed (I thought they were deleted)
  • Compiler goes crazy because of that.
  • Error don't make sense.
  • Tabsheet properties changed (tab visible, tab caption, name changed)
  • Among others.

After days of analyzing the problem and found that component name were changed, I tried going one by one and change names, but it is really time consuming.

I discovered that the editor goes crazy when any component that comes from the Delphi project has properties that are not defined in VSC (or Omnipascal for that matter). Some offenders are these properties: SelStart, SelLength, HeightPercent, WidthPercent and others.
The good thing is that VSC form designer warns when a property like that is not existent.

So my solution is:
Open the unit pascal file, switch to Form Designer. If some error like "Component xxx HeightPercent property does not exist" is shown, I immediately close everything and open the .dfm in a text editor (Yes, VSC can be used) and search/replace all offending properties/values with a blank space. A replace all is fine if many instances with same property and value are in the .dfm code.
Example: search (Ctrl-H) for "HeightPercent = 100.000000000000000000" replace with '' and click replace all. Then save the dfm file.
Repeat procedure for all of those offending properties on all the dfm files on the project and problem solved. I found hundreds of instances of offending properties.

As a matter of fact since I discovered the solution, I have removed the offending properties prior to any build attempt in VSC and I have had not a single similar problem since then.

There also appear some other errors in the migrated projects like some labels set background color to black, which is not solved by the above procedure, so I had to go by hand.

Also, prior to any build I have removed any reference in the uses clause that contains units starting with VCL, leaving only the corresponding ones that start with WEBLib.

Well, hope this helps someone.

About renaming components, we have found and fixed an issue on that, and we are working towards the next release which should be out soon. Sorry for that and thanks for all the feedback, we take note to improve the user experience. Thanks!

That is good!
It may not seem obvious but renaming a component on the dfm side only unlinks all methods and events, and all component calls by name don't know where to go, so manually renaming can be a big task. If you have a solution in the horizon, it sure will be a time saver.
And since compiler errors only pointed to missing component , it was really misleading until I understood what they means and why they happen.


Yes, we work very hard to release the next update as soon as possible that will address this and bring several other improvements!