// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using Microsoft.JScript; using Microsoft.JScript.Vsa; namespace E { public static class JS { private static VsaEngine eng = VsaEngine.CreateEngine(); public static object Evaluate(string s) { return Eval.JScriptEvaluate(s, eng); } } public class MainClass { public static void Main(string[] args) { object res = JS.Evaluate("(5 == 8) && (320 > 840) && (400.00 > 1000.00)"); Console.WriteLine(res.GetType().FullName + " " + res); } } }