|
|
|
NOTE: This Design document is subject to change at any time. |
Creates a new zApp component from within a script. This is the same as the core.AddControl function except that you are not forced to specify a name for the component.
If an empty Parent string is used, then a global zApp object is created. This argument is optional.
If an empty ObjectName string is used, then the object is not named and cannot be referenced by other objects. This argument is optional.
The other difference between this routine and core.AddControl is that CreateObject can also be used to create a Windows COM object. Instead of giving the zApp class name (like "zApp.zButton" or "button"), give the full Windows class name of the COM object you wish to create.
For example:
Code: |
<SCRIPT>
Set Button = core.CreateObject( "button", "ButtonPanel")
Set Excel = core.CreateObject("Excel.Application", "")
</SCRIPT> |
The first line of the script creates a reference to a new zApp BUTTON object and places it within the ButtonPanel parent object. The second line creates a reference to a Windows COM object that points to the Microsoft Excel application on your computer.
Uses in this manner, the core.CreateObject is similar to the VBScript "createobject" command. However, core.CreateObject can be used from any scripting language in zApp, not just VBScript. |
|