|
APGScript Object |
|
See Also: |
RunArgs() executes the APG script with a list of arguments.
VBScript:
JScript:
| oAPGScript | An APGScript object. |
| ArgList... | A comma-separated list of 0 or more arguments. |
For details on what happens when a script is run, see the APGScript.Run() topic.
The ArgList is placed in the Script.Arguments collection before the script is run.
This method cannot be called from Visual Basic - VB does not support parameters with the vararg attribute. To run an APG script from VB, use the Run() method. RunArgs() can only be called from VBScript, JScript, or C++.
A VBScript example for running an APGScript using RunArgs() :
Dim oAPGen, objScript
Set oAPGen = CreateObject("APGen")
' Open script.apg
Set objScript = oAPGen.OpenScript("script.apg")
' Create a "Foo" COM object to pass to the script
Dim objFoo
Set objFoo = CreateObject("Foo")
' Enable error handling, in case script.apg raises a fatal error
On Error Resume Next
' Run script.apg, pass in two arguments
objScript.RunArgs objFoo, "string param"
' Turn off error handling
On Error Goto 0
The objFoo object, and the string "string param" are inserted into the Script.Arguments collection. They are available when script.apg runs.