Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Parent-child script relation

$
0
0
Hi,

Following code does not work. Expected result is 20.
I have one global script and one child script that use it.
numValue variable from the global script is not available from in child script.
using(var globalScript = new VBScriptEngine())
using(var childScript = new VBScriptEngine())
{
    Console.WriteLine("Start VBScriptEngine");
    globalScript.Script.numValue = 4;
    childScript.Script.GlobalScript = globalScript.Script;
    Console.WriteLine(childScript.Evaluate("5 * numValue"));
    Console.WriteLine("End script");
    Console.ReadKey();
}

Viewing all articles
Browse latest Browse all 2297

Trending Articles