Page 1 of 1
how a script is called by code
Posted: Fri Jul 07, 2017 6:30 am
by softdevo@tiscali.it
Hi to all,
Sorry I did not understand how a script is called by code, and how to
get return values..
Thank you
how a script is called by code
Posted: Fri Jul 07, 2017 7:57 am
by robert
Danilo,
After the installation of X# you should have a shortcut on your desktop that brings you the public documents folder on your machine where we have installed some examples.
In the XSharp Script examples inside this folder you will find example programs.
The XIDE subfolder in this examples folder shows step by step examples that Nikos demonstrated in Cologne.
Example 1 shows how to call a script and get its return value with EvaluateAsync()
Example 2 shows how to pass arguments in a "Globals" objects
Example 3 shows how to catch errors
Example 4 shows how to compile a script without executing
Example 5 shows how to catch runtime errors
Example 6 shows how to handle strongly typed return values
Example 7 shows how you can compile a script once and run it many times
Example 8 shows a script that return a System.Func object
Example 9 shows how to access a function in the app from a script
Example 10 shows a script that uses the Dynamic type and late bound calls.
Please have a look at these scripts and let us know which thing you do not understand/
Note: If you want to use the scripts then make sure that the distributable files are available in the current folder or in the path. See the file "c:Program Files (x86)XSharpRedistRedist.txt" for a list of these DLLs.
Robert