Passing external parameters to scripts

The scripts can used externally defined objects. In Jint such values are called parameters. Any type of object can be used.

JintEngine engine = new JintEngine();
engine.SetParameter("a", 1);
engine.SetParameter("message", "Hello world!");
var result = engine.Run("return message + a;");
Console.WriteLine(result); // Displays 'Hello World!1'

Last edited Oct 24, 2009 at 1:12 PM by sebastienros, version 1


No comments yet.