Daniel R. Rossnagel wrote:
Sample:
String c="1+2+3"
For your first example, I believe that VB.NET contains some kind of
expression evaluator method, although I'm not sure about that. You
can, of course, write your own suite of expression parsers and
evaluators. It's so easy that I'm sure that there are several out on
the Web if you search for them.
Other Sample:
Int X=4
String c="1+2+3+X "
This, however, would not be possible as written, because at run time
the variable you called "X" no longer has a name, and may even have
been optimized away, so there would be no way to find "X" and discover
what its value was. There are other ways of accomplishing the same
thing, but you can't just mention the name of a variable somewhere and
trust that you can find it using Reflection or anything like that.