Thank you. The class Evaluator is really what I need. Just one thing: I need
to evaluate a boolean expression, like "84 < 70" or "7 >=8". So I tried to
add the following method to the class Evaluator
-------------------------------------------------------------------------------------
public static bool EvalToBoolean(string statement)
{
string s = EvalToString(statement);
return bool.Parse(s.ToString());
-------------------------------------------------------------------------------------
When I try to use the method
blnRes = Evaluator.EvalToBoolean("7<8")
I get an exception.
Is there a way to make it work?
Thank you
"Steven Spits" wrote:
"Federico Caselli" wrote:
I'm using visual basic.net, I need to take in input a string containing an
expression and return the value, example:
This is possible by generating code, compile it and execute, all at runtime!
I've done it, works like a charm! This article got me started:
http://www.odetocode.com/Code/80.aspx
Steven
- - -