mobileFX JavaScriptX - Google V8 JavaScript Embedded Framework
JavaScriptXLib ActiveX DLL / Module Object / AddCode Method
Required, JavaScript code to add to the Module.
In This Topic
    AddCode Method
    In This Topic
    Description
    Add code to the module
    Syntax
    Visual Basic
    Public Sub AddCode( _
       ByVal Code As String _
    ) 
    Parameters
    Code
    Required, JavaScript code to add to the Module.
    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