Dan

Dan

  • NA
  • 9
  • 0

Runtime Code Compiler

Jul 25 2008 6:50 PM
Right now I have an application which is sort of like Excel, but is more powerful in the fact that I can run C# code within each cell. A cell has a formula, which is any expression, and a function, which is the C# code. I can do any type of loop or logical statement in the function on a variable(s) and reference those in the formula.

Example:

Function
-----------------
int value = 0;
for( int x = 0; x < 10; x++ )
{
value ++ x;
}
Formula = value * 10
Result = 90


Right now I am doing this through CodeDom, which is a little slower than I would like. Is there another alternative I could do which is much faster but still gives me the power of being able to do what I can here?

Answers (2)