Thanks for your response. Not sure that operator overloading would help in this case. That would be good if I wanted to perform standard operations on a new class object.
In my case, what I want to do is the following:
Let's assume that we have a program with the following variables:
double x1 = 20;<br />
double x2 = 30;<br />
double y = 100;<br />
string s = "y + NewMethod(x1, x2)";
Furthermore, let's assume that NewMethod() is some method that performs a calculation on its two parameters and returns a value of type double. For example, let's assume that NewMethod(20,30) would produce 610.23 as a result.
I am looking for a method (let's call it "Formula()" for demonstation purposes), such that:
z = Formula(s);
would produce the same result as:
z = y + NewMethod(x1, x2);
(i.e. z would be equal to 710.23)