Hi,
I have following simple code. It works fine with MSScriptControl, but using VBScriptEngine it doesen't work:
I'm new to clearscript. What i#m doing wrong?
Best regards
nbgedo
I have following simple code. It works fine with MSScriptControl, but using VBScriptEngine it doesen't work:
private void btnExecuteScript_Click(object sender, EventArgs e)
{
try
{
using (ScriptEngine engine = new VBScriptEngine())
{
object[] array = new object[] { 1, 2, 3 };
engine.AddHostObject("arr", array);
var value = (string)engine.Evaluate("arr(1) = 1");
MessageBox.Show(value.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Error message is: "Object does not support the requested invocation operation"I'm new to clearscript. What i#m doing wrong?
Best regards
nbgedo