Danilo,
For scripting there are 2 possibilities:
1) use the "old" scripting that is based on the Roslyn Scripting. This is very powerful and allows you to even declare classes and methods in the script. These scripts are compiled into in memory assemblies and cannot be unloaded. So if you have a component that keeps running, this may cause memory problems after a while.
You will find some examples in the c:\Users\Public\Documents\XSharp\Scripting\XIDE folder on your machine. this is based on a session that Nikos did a few years ago on a conference
2) use the new "ExecScript()" function in the runtime. This allows you to execute a list of statements stored inside a string. You could see this list of statements as a method without header. You can receive parameters inside the script with the LPARAMETERS statement (this declares locals) or with the PARAMETERS statement (this declares privates).
The macro compiler will compile this into dynamic methods, that will be unloaded automatically when no longer in uses. So this uses less memory. I showed some examples of this in my online session about scripting.
You can declare locals with a type and also use VAR to derive the type at runtime. variables declared with LPARAMETERS are untyped, but you can assign these to typed locals if you want for better performance
Unfortunately there is not much to "read" about this. Maybe there is a volunteer that wants to write something ?
I think the example from STEFAN was based on the "old" scripting engine, since his merged file contains FUNCTION declarations.
Robert