Macro test jint in C#
;Put jint.dll in QM folder and run this macro.
out
CsScript x.AddCode("")
out x.Call("JS.Add" 5 6)
#ret
using System;
using Jint;
public class JS
{
public static int Add(int a, int b)
{
;var code=@"
function add(a, b) { return a + b; }
;";
;var engine = new Engine().Execute(code);
;var obj=engine.Invoke("add", a, b);
;return Convert.ToInt32(obj.ToString());
}
}
//If javascript code contains " characters, replace with ' or "". Example: var s = ""text"";