Andrea,
There really isn't anything that will allow you to do this. C# is not
an interpreted language, like JavaScript is. Because of that, there is no
easy eval functionality. You could write the code out yourself, and create
an assembly dynamically, but you would have to use reflection to make the
calls, or have an interface that is defined elsewhere implemented on the
classes you create.
You are better off creating an interface/base class definition and then
having classes derive from that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Andrea Williams said:
I'm looking for an equivalent to the JavaScript function 'eval'. Anyone
know one that will work in C#? I'm guessing that it doesn't exist due to
strong data typing, but thought I'd ask.
Thx!
Andrea