Returns a reference to another script component in the same package (.wsc file).
|
---|
value = createComponent(componentID) |
Values
- componentID
The unique identifier for the script component to create an instance of.
Remarks
Example
The following example shows two script components in the same package. The first script component calls the second script component when its math method is called.
| Copy Code |
---|
<package>
<component id="component1">
<registration progid="component.FrontEnd"/>
<public>
<method name="math"/>
</public>
<script language="JScript">
<![CDATA[
function math(){
return createComponent("component2")
}
]]>
</script>
</component>
<component id="component2">
<registration progid="component.Math"/>
<public>
<method name="add"/>
</public>
<script language="JScript">
<![CDATA[
function add(n1, n2){
return n1+n2;
}
]]>
</script>
</component>
</package> |
After registering this package, you can use it as illustrated in the following commands:
| Copy Code |
---|
set o1 = CreateObject("component.FrontEnd")
Set o2 = o1.math()
msgbox(o2.add(4,5)) |
See Also