APGen Documentation Previous Topic: APGen.Logon Next Topic: APGen.RunArgs() Parent Topic: APGen Object    APGen Object
APGen.Run()
See Also:

The Run() method executes an APG script.

Syntax

VBScript:

oAPGen.Run strScriptPath

JScript:

oAPGen.Run( strScriptPath );

Object

oAPGen An APGen object.

Parameters

strScriptPath The path of an APG script.  If strScriptPath is a relative path, then the path is appended to the current drive and directory, creating a full path.

Notes

For an example, see the programmatic execution topic.

Calling APGen.Run() is functionally equivalent to the following VBScript code:

' Assume oAPGen object has already been created
Dim oScript

' Open and load the script
Set oScript = oAPGen.OpenScript(strScriptPath)

' Run the script
oScript.Run

' Release the script
Set oScript = Nothing

If you are running an APG script multiple times, then call APGen.OpenScript() once, and use APGScript.Run() or APGScript.RunArgs() to run the script each time.  This saves the overhead of loading and parsing the APG script each time the script is run.

APGen.OpenScript() and the APGScript object allow more granular control over script execution than APGen.Run().

Applies To

APGen Object