3
I am creating a program that will allow the user to create and execute their own expressions.
Looking into it, I found the Compute
of DataTable
.
Ex:
DataTable dt = new DataTable();
var exp = dt.Compute("10 * (12+4) / 3", "");
With this command the user can type only mathematical formulas, but not for example a code for him (user) create a text box at runtime.
Ex:
DataTable dt = new DataTable();
var exp = dt.Compute(@"MessageBox.Show(""Teste de messagebox"", ""Título"");", "");
How can I do that?
If possible, without any external bookstore.
Related or duplicate: http://answall.com/q/15428/101
– Maniero
Is the idea just a math evaluator? Or do you want something else? Which operators would you like to implement?
– Leonel Sanches da Silva
That I could type anything, like classes.
– Ismael
Ah, so it’s already answered.
– Leonel Sanches da Silva