xsharp.eu • longtime VO code migration to X#
Page 1 of 1

longtime VO code migration to X#

Posted: Sun Jul 16, 2023 9:41 am
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
 

longtime VO code migration to X#

Posted: Sun Jul 16, 2023 9:58 am
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}

longtime VO code migration to X#

Posted: Sun Jul 16, 2023 10:10 am
by wriedmann
Hi Chris,
they are already working or is this a proposal?
They would solve my problem!
Wolfgang

longtime VO code migration to X#

Posted: Sun Jul 16, 2023 1:09 pm
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

longtime VO code migration to X#

Posted: Sun Jul 16, 2023 3:24 pm
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.

longtime VO code migration to X#

Posted: Mon Jul 17, 2023 4:03 am
by wriedmann
Hi Chris,
thank you very much!
It would be very useful to implement something like this.
Wolfgang

longtime VO code migration to X#

Posted: Tue Jul 18, 2023 6:46 am
by Chris
Hi Wolfgang,

Those tags are now implemented for the next build!

longtime VO code migration to X#

Posted: Tue Jul 18, 2023 7:28 am
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