fbpx

Transform() and Core

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 2 weeks ago #1 by Wolfgang Riedmann
Transform() and Core was created by Wolfgang Riedmann
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

Please Log in or Create an account to join the conversation.

More
7 months 2 weeks ago #2 by Robert van der Hulst
Replied by Robert van der Hulst on topic Transform() and Core
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
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

  • Wolfgang Riedmann
  • Wolfgang Riedmann's Avatar Topic Author
  • Offline
More
7 months 2 weeks ago #3 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic Transform() and Core
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

Please Log in or Create an account to join the conversation.

More
7 months 2 weeks ago #4 by Robert van der Hulst
Replied by Robert van der Hulst on topic Transform() and Core
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
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.