|
APGen Object Reference |
|
See Also: |
The APGScript object is used for Programmatic Execution of APG scripts.
| oAPGScript | An APGScript object. |
| key | A string key to the Values collection. |
| index | A zero-based index to the Values collection. |
| Values | The default collection for the APGScript object. |
| Arguments | A collection of type ScriptArguments containing arguments passed to the APG script. |
| Error | This event fires when an error (syntax, runtime, or component) occurs while running the APG script. |
| Filename | String | Returns the filename of the root APG script. |
| Dir | String | Returns the directory of the root APG script. |
| Path | String | Returns the complete path of the root APG script. |
| LastModified | Date/Time | Returns the most recent date/time that any of the source files were modified. |
| Debug | True/False | Sets/returns whether script errors cause error dialogs and Just-In-Time debugging. Default value is True. |
| Waiting | True/False | Returns whether the script is currently in an APGScript.Wait() statement. |
| OnError | Function | Sets a script (IDispatch) function to be called when an error occurs. |
| APGen | Object | Returns the script's parent APGen object. |
| Output | Object | Returns the script's Output object. |
| Log | Object | Returns the script's Log object. |
| Util | Object | Returns the script's Util object. |
| StartInDebugger | True/False | Sets/returns whether to break in the debugger when the script is started. |
| Globals | Object | Returns an IDispatch object containing script global variables and procedures. |
| Abort() | Halts execution of the script. |
| CreateObject() | Creates a COM object, and optionally activates script event handling for the object. |
| ConnectEvents() | Connects script event handling to an object. |
| DisconnectEvents() | Disconnects script event handling for an object. |
| GetLastError() | Returns the APGError object for the last error that occurred. |
| Wait() | Waits for a specified interval, or until StopWait() is called. |
| StopWait() | Interrupts a Wait() call. |
| Run() | Executes the script. |
| RunArgs() | Executes the script with a list of arguments. |
APGScript objects can only be obtained from APGen.OpenScript().
The APGScript interface is a superset of the intrinsic Script object interface. The APGScript interface and the Script interface represent two sides of the same object, and their common methods and properties are identical. The APGScript interface is used to manage an APG script from outside of the script. The Script object is used within an APG script to refer to the (containing) script.
For an example using both interfaces, see the Script Object topic.
Figure 1 shows a diagram of the APGScript object. The APGScript object encapsulates a script file, and a number of intrinsic objects. Note that the external (IAPGScript) interface is connected to the intrinsic Script object - the internal Script object and the external IAPGScript interface provide access to the same object.
| Figure 1: APGScript Object |
![]() |
To use the APGScript object in C++, see the IAPGScript interface in <install dir>\include\APGen.h.