Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The EVAL function
Message
From
21/06/2001 16:48:52
 
 
To
21/06/2001 14:28:46
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00522089
Message ID:
00522178
Views:
10
>In Both VB Script and VBA, there is the Eval function to evaluate an expression and return the result from the expression, Eval() does not exist in VB. So how do you do the same thing in VB?

By adding a reference to the script control and creating objects off of it (syntax untested):
Dim oSC as ScriptControl
Set oSC = New ScriptControl
oSC.Language = "VBScript"
Debug.Print oSC.Eval("5 * 3")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform