GefProcAction.SetToInvokeScript (method)

Configures the action to invoke a script entry point in an object.
Syntax: object.SetToInvokeScript ObjectName, EntryName, ResulPoint, ArgumentExprs, ArgumentSetpoints
Parameters:
ObjectName As String -
EntryName As String -
Optional ResulPoint As String -
Optional ArgumentExprs As SAFEARRAY(BSTR)* -
Optional ArgumentSetpoints As SAFEARRAY(VARIANT_BOOL)* -
Description: Changes the Type of the action to GefActionInvokeScript.

The arguments correspond to the fields in the action panel of the Procedure Information dialog box.

The arrayArgumentExpressions parameter is an array of String values. The arrayArgumentSetpoints parameter is an array of Boolean values.

Example:

Function DoStuff(A As String) As String
  DoStuff = "Bye"
End Function
    
Sub DoStuff2(A As String, B As String)
End Sub
    
Sub GefProcAction_SetToInvokeScript()
    Dim oCimObj As GefObject
    Dim oCimProceduresObj As GefProcedures
    Dim oCimProcedObj As GefProcedure
    Dim oCimProcActs As GefProcActions
    Dim oCimProcActNew As GefProcAction
    
    Set oCimObj = CimGetObject
    Set oCimProceduresObj = oCimObj.Procedures
    
    If oCimProceduresObj.Count > 0 Then
        Set oCimProcedObj = oCimProceduresObj.Item(0)
    
        Set oCimProcActs = oCimProcedObj.Actions
    
        Dim argExrArray As Variant
        Dim argSetptArray As Variant
    
        Set argExrArray = CimCreateSafeArray()
        Set argSetptArray = CimCreateSafeArray()
    
        argExrArray.CreateVector cimVString, 0, 1
        argSetptArray.CreateVector cimVBoolean, 0, 1
    
        argExrArray.SetVectorElement 0, "TestPointA"
        argSetptArray.SetVectorElement 0, True
    
        Set oCimProcActNew = oCimProcActs.Add(gefActionInvokeScript)
    
        oCimProcActNew.SetToInvokeScript oCimObj.Name, "DoStuff", "{ResultVar", argExrArray, argSetptArray}
    
        Dim Args(0 To 1) As String
        Dim ArgDoSetPoints(0 To 1) As Boolean
    
        Args(0) ="""Start"""
        Args(1) ="""Finish"""
    
        ArgDoSetPoints(0) = False
        ArgDoSetPoints(1) = False
    
        Set oCimProcActNew = oCimProcActs.Add(gefActionInvokeScript)
        oCimProcActNew.SetToInvokeScript oCimObj.Name, "DoStuff2", "", Args, ArgDoSetPoints
    
    End If
End Sub
See Also: GetInvokeScript