Transform() and Core

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

Transform() and Core

Post by wriedmann »

Hi Robert,

the Transform() is one of the most important functions for me, and one the .NET Framework does not have.

My plan is to write future X# applications to use the Core dialect whenerver possible. Therefore I would need a sort of Transform() function in the XSharp.Core library (and maybe other people also).

Since the Transform() function can have parameters of type "usual", IMHO it is not possible to have this function the XSharp.Core library, but it must remain in the XSharp.VO library.

But it should be possible to have the core funtionality of both the Transform() and the Untransform() function with another name in the XSharp.Core library and have the functions in the XSharp.Vulcan library call the ones in the XSharp.Core library.

Why the Transform() function is so important to me? I was never able to understand how people that builds business applications can use controls without a input picture. One of the most stupid samples is in Outlook: you can put even letters in the "new appoinment" dialog in the time fields.

Therefore when the runtime is available I will try to release an edit control for both WinForms and WPF that accepts a Xbase style picture.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transform() and Core

Post by robert »

Wolfgang,

I have thought about that too, but it is more complicated than you think.

At this moment the TransForm function is indeed in the XSharp.VO assembly.
You can see that code in Github:
https://github.com/X-Sharp/XSharpPublic/blob/feature/Runtime/Runtime/XSharp.VO/Functions/Transform.prg

Its sibling function Unformat is in the same file.

There are "worker methods" for various types in that code.
And the code is mostly Clipper/VO style code. We could easily convert that code to use .Net methods in stead of Clipper/VO style functions but did not have the time to do all of that.

It is not so easy to move that code to XSharp.Core because some of the methods TransformD and UnformatD depend on the Date Type and functions like CTOD and DTOC. The TransFormN function also calls runtime functions like Str2() and Str3() which accept FLOAT parameters.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Transform() and Core

Post by wriedmann »

Hi Robert,

thank you very much for your answer!
You are right about the date and the float datatype. So we have to live with the fact that this function will require a dependency to XSharp.VO.

Personally, I cannot wait for the moment the float datatype is dead - the decimal datatype is so much better for business applications that this will be the first larger change after the migration.

Wolfgang

P.S. Is is always a joy to see such cleanly written code - I always feel I have to learn a lot
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transform() and Core

Post by robert »

Wolfgang,
wriedmann wrote: P.S. Is is always a joy to see such cleanly written code - I always feel I have to learn a lot
Well, if you have to publish your code, like in an open source project, you know people will have a look at your code, so you have to do it properly :) .

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply