mobileFX JavaScriptX - Google V8 JavaScript Embedded Framework
JavaScriptXLib ActiveX DLL / Module Object / Eval Method

Required. String containing the expression being evaluated.

In This Topic
    Eval Method
    In This Topic
    Description
    Evaluate an expression within the context of the module
    Syntax
    Visual Basic
    Public Function Eval( _
       ByVal Expression As String _
    ) As Variant
    Parameters
    Expression

    Required. String containing the expression being evaluated.

    Return Type

    Variant containing the result of Eval.

    Example
    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
    See Also