Hi furesoft,
Here's a sample that sets up a script-callable function for converting any array-like JavaScript object to a .NET array:
And here's how you might use it from script code:
Good luck!
Here's a sample that sets up a script-callable function for converting any array-like JavaScript object to a .NET array:
engine.Script.toClrArray = new Func<dynamic, object>(obj => { var result = newobject[obj.length]; for (var i = 0; i < result.Length; ++i) result[i] = obj[i]; return result; });
engine.Execute(@"
function MakeClrArray() {
return toClrArray(arguments)
};
var foo = MakeClrArray(1, 2, 3, 'bar', Math.PI);
");