J
Joe
I have a screen which allows the user to create mathematical expressions
using a combination of literal values, other expressions and field values.
For example if I have the following:
// fields
string val1 = "2";
string val2 = "1";
string val3 = "4.5";
//expressions
string expr1 = "8 * val1 / val2 + val3";
string expr2 = "val2 * expr1 + 3";
I need to parse this out to perform the actually calculation.
string expr2 would expand to 1 * 8 * 2 / 1 + 3 + 3;
Any suggestions on how to do this? I already created a number of classes to
handle this but I'm still missing some possible combinations.
using a combination of literal values, other expressions and field values.
For example if I have the following:
// fields
string val1 = "2";
string val2 = "1";
string val3 = "4.5";
//expressions
string expr1 = "8 * val1 / val2 + val3";
string expr2 = "val2 * expr1 + 3";
I need to parse this out to perform the actually calculation.
string expr2 would expand to 1 * 8 * 2 / 1 + 3 + 3;
Any suggestions on how to do this? I already created a number of classes to
handle this but I'm still missing some possible combinations.