Evaluate an expression within the context of the module
Required. String containing the expression being evaluated.
Visual Basic |
---|
Public Function Eval( _ ByVal Expression As String _ ) As Variant |
Required. String containing the expression being evaluated.
Variant containing the result of Eval.
Private Sub Form_Load() Dim SC As ScriptControl Dim m As Module Dim Result As Variant Set SC = New ScriptControl SC.Language = "JavaScript" SC.AllowUI = True SC.SitehWnd = Me.hWnd SC.UseSafeSubset = False SC.Timeout = 60 Set m = SC.Modules.Add("MyModule") m.AddCode "function goo(a,b,c){ return a+b+c; }" Result = m.Eval("goo(1,2,3)") Debug.Print Result End Sub