|
Evaluate Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
Evaluate(Interpreter As Long, CommandString As String, CommandOutput As String, ErrorLine As Long, Flags As Long, Reserved As Long) As Long
|
|
Input
|
The "Interpreter" parameter, which must be a valid interpreter pointer.
The "CommandString" parameter, which contains the commands to evaluate.
The "Flags" parameter, which can be any of the evaluation flags in the TCLBCommandOptions enumeration.
The "Reserved" parameter, which is reserved for future use and must be zero.
|
|
Output
|
The "CommandOutput" parameter, which receives the result of the evaluation.
The "ErrorLine" may be modified to contain the line number of an evaluation error, if any.
Initially, the "CommandOutput" parameter must be NULL (vbNullString).
|
|
Returns
|
The result of the evaluation, which will be one of the following:
TCL_OK TCL_ERROR TCL_RETURN TCL_BREAK TCL_CONTINUE |
|
COM Results
|
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "Interpreter" parameter is invalid. E_FAIL: The Tcl interpreter returned an unknown result. |
|
Side Effects
|
One or more custom commands may be called by the interpreter.
This method should be called with great care from inside custom commands, otherwise unwanted recursion may occur.
|
|
Description
|
This method calls another method based on what evaluation flags are specified.
It calls either EvaluateString, EvaluateGlobalString, or EvaluateFile.
The result of the evaluation is placed into the "CommandOutput" parameter.
If an evaluation error occurs, the line number of the error is placed into the "ErrorLine" parameter.
|
|
Notes
|
None.
|
|
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.Evaluate(plInterpreter, "set x [clock seconds]", psOutput, 0&, TCLBCommandOptions.TCLB_cSTRING Or TCLBCommandOptions.TCLB_cGLOBAL, 0&) Call poTcl.DeleteInterpreter(plInterpreter) Set poTcl = Nothing End Sub |