Hi Dzemo
I'm tempted to say use JScript.NET!!
Try this:
1. Create a file called: DynamicMath.js
2. Add this code to it:
class DynamicMath
{
static function Eval(MathExpression : String) : double
{
return eval(MathExpression);
};
}
3. Compile it with the command line jsc compiler: jsc /t:library
DynamicMath.js
4. Add a reference to DynamicMath.dll to your project (and to
Microsoft.JScript.dll as well)
5. Use from your favourite .NET language:
Dim d As Double = DynamicMath.Eval("2 + 3 + 4")
MessageBox.Show(d)
6. That's it..
HTH
Nigel Armstrong
"Dzemo" wrote:
i have string "2+6/3-8/2" and how to get result (in this case is 0). String
can be any formula with 4 basic math operations
thx