DeleteCommand Method
Applies To
BasicTcl Object, AdvancedTcl Object
Prototype
DeleteCommand(Interpreter As Long, CommandName As String) As Long
Input
The "Interpreter" parameter, which must be a valid interpreter pointer. The "CommandName" parameter, which must be the name of an existing custom command added with the CreateCommand method.
Output
None.
Returns
Undefined.
COM Results
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed, the "Interpreter" parameter is invalid, or the custom command specified by the "CommandName" parameter was not found.
Side Effects
Upon success, a COM reference is released from the object specified in the "CallbackObject" parameter from the call to the CreateCommand method and the custom command is removed from the specified interpreter.
Description
This method is a wrapper around the Tcl_DeleteCommand function. It deletes the custom command from the specified interpreter and the internal data necessary to call the specified object via the IDispatch interface.
Notes
None.
Example
Private Sub Command1_Click()
    Dim poTcl As TclBridge.BasicTcl
    Dim poClass As Class1
    Dim plInterpreter As Long

    Set poTcl = New TclBridge.BasicTcl
    Set poClass = New Class1

    Call poTcl.CreateInterpreter(plInterpreter)

    Call poTcl.CreateCommand(plInterpreter, "Tester1", poClass, "Test1", 1234&, 0&)

    ' the EvaluateString method or the EvaluateFile method could be used here to test the new custom command...

    Call poTcl.DeleteCommand(plInterpreter, "Tester1")

    Call poTcl.DeleteInterpreter(plInterpreter)

    Set poClass = Nothing
    Set poTcl = Nothing
End Sub