GefProcActions.MoveAction (method)

Rearranges the actions in the procedure.
Syntax: object.MoveAction FromIndex, ToIndex
Parameters:
FromIndex As long -
ToIndex As long -
Description: The action at FromIndex is effectively removed from the collection and then re-added such that its new index is ToIndex.

The actions in a procedure are executed in order. This method allows you to rearrange that order.

Example:

Sub GefProcActions_MoveAction()
    
    Dim oCimObj As GefObject
    Dim oCimProceduresObj As GefProcedures
    Dim oCimProcedObj As GefProcedure
    Dim oCimProcAct As GefProcActions
    
    Set oCimObj = CimGetObject
    Set oCimProceduresObj = oCimObj.Procedures
    If oCimProceduresObj.Count > 0 Then
        Set oCimProcedObj = oCimProceduresObj.Item(0)
        Set oCimProcAct = oCimProcedObj.Actions
        If oCimProcAct.Count > 1 Then
            oCimProcAct.MoveAction 0, 1
            MsgBox "The actions have been moved"
        Else
            MsgBox "There is only one action so the " & _
                "actions order cannot be changed"
        End If
    Else
        MsgBox "The object does not have any procedures"
    End If
    
End Sub