|
CreateInterpreter Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
CreateInterpreter(Interpreter As Long) As Long
|
|
Input
|
The "Interpreter" parameter, which must be zero.
|
|
Output
|
The "Interpreter" parameter is modified to contain a pointer to the new interpreter.
|
|
Returns
|
Undefined.
|
|
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.
|
|
Description
|
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.
|
|
Notes
|
It is important to release interpreters created by this method using the DeleteInterpreter method.
|
|
Example
|
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 |