How to evaluate string form of numeric expression in VBA?
On Dec 31, 6:38*am, Dave Peterson wrote:
If the string you're evaluating is simple, maybe you could parse it to its
component parts and do the arithmetic yourself using VBA's functions.
But parsing a generic string/formula sounds pretty daunting to me.
Parse __and__ generate Intel-compatible assembly code!! I believe
that would be the only way of ensuring exactly the same results that
VBA produces, including side-effects of using the FPU registers for
intermediate results. (Unless, of course, you are also proposing that
I emulate the 80-bit arithmetic as well <wink.)
And yes, I would need a generic expression parser/code-generator
because the expressions are complex and unpredictable.
Enough said! I take your response to mean: there is no such thing as
"someFunction" in VBA that will evaluate a numeric expression in
string form exactly as if I had entered it into VBA directly.
Not the answer I wanted. But thanks for clearing that up for me.
|