longtime VO code migration to X#

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

longtime VO code migration to X#

Post by wriedmann »

Hi Chris (as Mr. XPorter...),
since I'm in the migration process of my VO applications and will be there for a few years (if I'm ever able to exit from it): my main VO library has some code that is incompatible with X# not only in the code part, but also in the function/method declarations.
The VO version of the library is changed sometimes on the VO side, so I need to port it over to X# every few months or so to be compatible.
For differences in the code itself, the #ifdef statement works very well:

Code: Select all

otherwise
// not supported
#ifdef __XSHARP__
  NOP
#endif
endcase 
But what can I do with code like this?
VO:

Code: Select all

method GetPage( nPage ) class DynamicTabControl
X#:

Code: Select all

method GetPage( nPage as usual ) as VO.Window strict
to be compatible between X# and VO?
It would need some tag in the VO code so that the XPorter knows that this VO line has to be commented out, and another tag so that XPorter knows to remove the commend lines.

Wolfgang
 
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

longtime VO code migration to X#

Post by Chris »

Hi Wolfgang,

I understand, how about some tags like that to comment, uncomment and remove lines:

METHOD SomeMethod() CLASS TestClass // {VOXP:COM}
METHOD SomeMethod() CLASS TestClass // {VOXP:UNC}
METHOD SomeMethod() CLASS TestClass // {VOXP:REM}
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

longtime VO code migration to X#

Post by wriedmann »

Hi Chris,
they are already working or is this a proposal?
They would solve my problem!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

longtime VO code migration to X#

Post by ic2 »

Hello Wolfgang,

At least you have to check the option to keep the class names on Xporting code; I guess the comments will be preserved too.

As everything between the classname in .Net and some End statement belongs to that class it is not necessarily. I have kept it on the few VO programs I have XPorted to have at least a bit of an idea of what I am looking at without the need to hope the current class is somewhere else visible in the screen or without the need to browse up a few 1000 lines.
Great thing of X# is that classnames are actually checked! I've copied some code from time to time created in another class (I do a quite some fist editing in VO for X# code anyway) and when I've done the main work in VO and the copy the well formatted code to X# and compile (forgetting to adapt the class name) I get a nice compiler message!

I would suggest to always import the class and probably also to make that the default (checked) option in XPorter.

Dick
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

longtime VO code migration to X#

Post by Chris »

Hi Wolfgang,

It's just a proposal. I checked just in case I had already implemented something like that and forgot about it (which is very common! :)), but didn't find something.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

longtime VO code migration to X#

Post by wriedmann »

Hi Chris,
thank you very much!
It would be very useful to implement something like this.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

longtime VO code migration to X#

Post by Chris »

Hi Wolfgang,

Those tags are now implemented for the next build!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

longtime VO code migration to X#

Post by wriedmann »

Hi Chris,
thank you very much!
I will adjust my source code and update my documentation when the new version is out.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply