D
david
I have searched existing posts and have not found an answer to this
variation of an old question. I have the following string stored in a
variable
Dim str as String = "If 9000 < 10200 Then (6 - 5 ) * (10200 - 9000)
else 0 End If"
How do I evaluate/execute the string as code and return the answer, in
this case: 1200?
Previous examples of eval/execute have used the MSScriptControl to
return the value of a numeric equation, but those did not have the If
Then Else syntax. MSScriptControl generates syntax errors on my
equation.
variation of an old question. I have the following string stored in a
variable
Dim str as String = "If 9000 < 10200 Then (6 - 5 ) * (10200 - 9000)
else 0 End If"
How do I evaluate/execute the string as code and return the answer, in
this case: 1200?
Previous examples of eval/execute have used the MSScriptControl to
return the value of a numeric equation, but those did not have the If
Then Else syntax. MSScriptControl generates syntax errors on my
equation.