W
Wade
Hi guys,
I am building a string in code that is a mathematical formula, based on a
lot of criteria specified by the user. Once the formula is complete, I want
to evaluate it to get a result. For example:
dim strFormula as String
strFormula = "((2 + 2) * 3) / 4) - 5"
Once I have this formula, I want to evaluate it and get the result: -2.
Any tips on how I can do this?
Also, is there a way to check if the formula is valid (i.e. I didn't miss
any parenthesis or anything)? I guess I could try to evaluate it, and stick
it in a try - catch block.
Thanks for your time and help!
Wade
I am building a string in code that is a mathematical formula, based on a
lot of criteria specified by the user. Once the formula is complete, I want
to evaluate it to get a result. For example:
dim strFormula as String
strFormula = "((2 + 2) * 3) / 4) - 5"
Once I have this formula, I want to evaluate it and get the result: -2.
Any tips on how I can do this?
Also, is there a way to check if the formula is valid (i.e. I didn't miss
any parenthesis or anything)? I guess I could try to evaluate it, and stick
it in a try - catch block.
Thanks for your time and help!
Wade