About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

 Related 
Contents
See also:
  AddControl
Core Library
  ExecWindow
  AddAutoUpdate
  Recalc
  Eval
  Exec
  StartWait
  EndWait
  Version
  AddControl
  FindControl
  ExecuteAction
  AbortAction
  OpenWindow
  ReadIni
  WriteIni
  FlushIni
  CreateObject
  MsgBox
  Prompt
  Confirm
  ThemeIndex
  Theme
  PromptConnection
  ParamCount
  Param
  OptionExists
  OptionValue
  OptionCount
  Die
  Path
Related Links:
  SQLStore
  Query
  Collection
  CreateObject
  Web Library
  Template
  Example: $if statement
  Example: $case statement
  Example: Context
  Example: $begin loops
  Templates in ZML code
  SaveToFile
CreateObject [[Core.CreateObject]] 
NOTE: This Design document is subject to change at any time.
CreateObject(ClassName: Widestring; Parent: WideString, ObjectName: WideString): Variant


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.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net