Good day all,
As I promised, will keep you updated.
On foxite I also made the same announcement I posted here, regarding the X# Roadmap for 2019.
Tom Knauf, then responded with the following. I also include my reply. Hope it is of interest to some of hopefully all:
What I am mising is something like execscript(cCode). I can have any code including if then, variables, calls to own
functions,... in a char variable and it will be executed.
We built a complex script system to allow user their own workflow and
never found a good replascement in c#, windev,...
An own parser would be extremly much work to do. Any plans/ideas on that ?
Hi Tom,
No plans/ideas are needed. X# already contains xsScript. The following will already run:
*File:HelloWord.prgx // Note the x in the file name if you want it to run directly.
CLASS MyHelloWorldClass PROTECTED txtAS STRING
CONSTRUCTOR()&& The Init of VFP classes txt :="Hello World from Class" RETURN
PROPERTY SpeakAS STRING GET txt&& Access/Assign = PROPERTY GET/SET in X# END CLASS FUNCTION HelloWorld()AS STRING RETURN "Hello World from Function" PROCEDURE HelloWorldProc() System.Windows.Forms.Console.Writeline("Hello world from Procedure") RETURN
FUNCTION Start()AS VOID ?HelloWorld() HelloWorldProc() ?MyHelloWorldClass{}:Speak RETURN
*End of File:HelloWorld.prgx
In your program you just have to
obj := xsScript(cCode :=FileToStr("c:...\HelloWorld.prgx")) && Note obj will now hold an in memory compiled version of HelloWorld.prgx, && that you can happily pass anywhere in your application, && no "parsing" of the script needed anymore!!!! obj:Start()
You now speaking to the Clipper guy who already work the last 25 years exclusively on what you describe above, called in the Clipper/VO/Vulcan/X# world Data-driven applications. I have a slightly different approach, I store my scripts in a Relational Database and not in zillions of txt files.
I am busy writing a series on the concept of which the first 12 of [Insert end of series here] articles are already available in the downloads area of the X# webpage. https://www.xsharp.info/itm-downloads?folder=general%252FLessons
Would you be interested in a joint venture, where we take the best of both those worlds
Solution := ((XBase := VFP * Clipper fork) * (Knowledge := Tom * Johan) * (Environment := X# * .NET)) ? Solution:ToString()&& A 100% .NET solution that runs at 99% of the speed of a compiled Application.NET, but was created in 1% of the time it will require a developer to roll out in PRG files?
Looking forward to hear from you or anybody else using data-driven techniques,
Johan Nel George, South Africa Friends of XSharp http://xsharp.info http://xsharp.info/
This code looks strongly typed. Is this just a conduit/adapter to push xBase like code to function in C#?
If you have to learn the conduit, why not learn C#?
On Fri, Apr 5, 2019 at 7:11 AM Johan Nel johan.nel@xsinet.co.za wrote:
Good day all,
As I promised, will keep you updated.
On foxite I also made the same announcement I posted here, regarding the X# Roadmap for 2019.
Tom Knauf, then responded with the following. I also include my reply. Hope it is of interest to some of hopefully all:
What I am mising is something like execscript(cCode). I can have any code including if then, variables, calls to own
functions,... in a char variable and it will be executed.
We built a complex script system to allow user their own workflow and
never found a good replascement in c#, windev,...
An own parser would be extremly much work to do. Any plans/ideas on that ?
Hi Tom,
No plans/ideas are needed. X# already contains xsScript. The following will already run:
*File:HelloWord.prgx // Note the x in the file name if you want it to run directly.
CLASS MyHelloWorldClass PROTECTED txtAS STRING
CONSTRUCTOR()&& The Init of VFP classes txt :="Hello World from Class" RETURN
PROPERTY SpeakAS STRING GET txt&& Access/Assign = PROPERTY GET/SET in X# END CLASS FUNCTION HelloWorld()AS STRING RETURN "Hello World from Function" PROCEDURE HelloWorldProc() System.Windows.Forms.Console.Writeline("Hello world from Procedure") RETURN
FUNCTION Start()AS VOID ?HelloWorld() HelloWorldProc() ?MyHelloWorldClass{}:Speak RETURN
*End of File:HelloWorld.prgx
In your program you just have to
obj := xsScript(cCode :=FileToStr("c:...\HelloWorld.prgx")) && Note obj will now hold an in memory compiled version of HelloWorld.prgx, && that you can happily pass anywhere in your application, && no "parsing" of the script needed anymore!!!! obj:Start()
You now speaking to the Clipper guy who already work the last 25 years exclusively on what you describe above, called in the Clipper/VO/Vulcan/X# world Data-driven applications. I have a slightly different approach, I store my scripts in a Relational Database and not in zillions of txt files.
I am busy writing a series on the concept of which the first 12 of [Insert end of series here] articles are already available in the downloads area of the X# webpage. https://www.xsharp.info/itm-downloads?folder=general%252FLessons
Would you be interested in a joint venture, where we take the best of both those worlds
Solution := ((XBase := VFP * Clipper fork) * (Knowledge := Tom * Johan) * (Environment := X# * .NET)) ? Solution:ToString()&& A 100% .NET solution that runs at 99% of the speed of a compiled Application.NET, but was created in 1% of the time it will require a developer to roll out in PRG files?
Looking forward to hear from you or anybody else using data-driven techniques,
Johan Nel George, South Africa Friends of XSharp http://xsharp.info http://xsharp.info/
[excessive quoting removed by server]
https://github.com/oleg-shilo/cs-script
Hi Stephen,
On 2019/04/05 15:29, Stephen Russell wrote:
This code looks strongly typed. Is this just a conduit/adapter to push xBase like code to function in C#? If you have to learn the conduit, why not learn C#?
Yes it looks strongly typed because I want to make use of the speed improvement it achieves. X# allows both lazy and strongly typed variable declaration. The choice is yours. I prefer and am already strongly typing my code since Visual Objects days which allowed also both. I prefer the early error trapping at compile time, above fixing bugs only discovered at runtime...
Johan Nel George, South Africa Friends of XSharp http://xsharp.info https://www.xsharp.info/forum/public-vfp
As a long time C# coder I too strongly type ALL objects.
On Mon, Apr 8, 2019 at 11:42 AM Johan Nel johan.nel@xsinet.co.za wrote:
Hi Stephen,
On 2019/04/05 15:29, Stephen Russell wrote:
This code looks strongly typed. Is this just a conduit/adapter to push xBase like code to function in C#? If you have to learn the conduit, why not learn C#?
Yes it looks strongly typed because I want to make use of the speed improvement it achieves. X# allows both lazy and strongly typed variable declaration. The choice is yours. I prefer and am already strongly typing my code since Visual Objects days which allowed also both. I prefer the early error trapping at compile time, above fixing bugs only discovered at runtime...
Johan Nel George, South Africa Friends of XSharp http://xsharp.info https://www.xsharp.info/forum/public-vfp
[excessive quoting removed by server]