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

RunArgs() executes the APG script with a list of arguments.

Syntax

VBScript:

oAPGScript.RunArgs ArgList...

JScript:

oAPGScript.RunArgs( ArgList... );

Object

oAPGScript An APGScript object.

Parameters

ArgList... A comma-separated list of 0 or more arguments.

Notes

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++.

Example

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.

Applies To

APGScript Object