mobileFX JavaScriptX - Google V8 JavaScript Embedded Framework
JavaScriptXLib ActiveX DLL / Modules Collection / Item Property

Required. Variant with either the string name of the module or an integer with its index.

In This Topic
    Item Property
    In This Topic
    Description
    Get a module indexed by position or module name
    Property type
    Read-only property
    Syntax
    Visual Basic
    Public Property Item( _
       ByVal Index As Variant _
    ) As Module
    Parameters
    Index

    Required. Variant with either the string name of the module or an integer with its index.

    Example
    Private Sub Form_Load()
        
        Dim SC As ScriptControl
        Dim m As Module
        
        Set SC = New ScriptControl
        SC.Language = "JavaScript"
        SC.AllowUI = True
        SC.SitehWnd = Me.hWnd
        SC.UseSafeSubset = False
        SC.Timeout = 60
        
        Set m = SC.Modules("GlobalModule")
            
        Set m = SC.Modules.Add("MyModule")
        m.AddCode "function goo(a,b,c){ return a+b+c; }"
        
        Set m = SC.Modules.Add(1) 'GlobalModule
        Set m = SC.Modules.Add(2) 'MyModule
        
        For Each m In SC.Modules
            Debug.Print m.Name
        Next
            
    End Sub
    Private Sub Form_Load()
        
        Dim SC As ScriptControl
        Dim m As Module
        Dim f As Procedure
        
        Set SC = New ScriptControl
        SC.Language = "JavaScript"
        SC.AllowUI = True
        SC.SitehWnd = Me.hWnd
        SC.UseSafeSubset = False
        SC.Timeout = 60
            
        SC.AddCode "function foo(a,b,c){ return a+b+c; }"
        
        Set m = SC.Modules("GlobalModule")
        m.AddCode "function goo(a,b,c){ return a+b+c; }"
            
        For Each m In SC.Modules
            For Each f In m.Procedures
                Debug.Print m.Name & "." & f.Name & "( args = " & f.NumArgs & ")"
            Next
        Next
        
    End Sub
    See Also