CreateInterpreter Method
Applies To
BasicTcl Object, AdvancedTcl Object
CreateInterpreter(Interpreter As Long) As Long
The "Interpreter" parameter, which must be zero.
The "Interpreter" parameter is modified to contain a pointer to the new interpreter.
COM Results
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "Interpreter" parameter is not zero.
E_FAIL: The Tcl API did not appear to create a new interpreter.
Side Effects
During interpreter creation, various Windows messages may be processed in addition to the normal processing done by Tcl to create an interpreter.
This method is a wrapper around the Tcl_CreateInterp function. A new interpreter is created and the resulting pointer is placed into the "Interpreter" parameter.
It is important to release interpreters created by this method using the DeleteInterpreter method.
Private Sub Command1_Click()
    Dim poTcl As TclBridge.BasicTcl
    Dim plInterpreter As Long
    Dim psOutput As String

    Set poTcl = New TclBridge.BasicTcl

    Call poTcl.CreateInterpreter(plInterpreter)

    ' psOutput will equal the current clock value in seconds
    ' since the "start of time"

    psOutput = vbNullString
    plResult = poTcl.EvaluateString(plInterpreter, "set x [clock seconds]", psOutput, 0&)

    Call poTcl.DeleteInterpreter(plInterpreter)

    Set poTcl = Nothing
End Sub