|
EvaluateFile Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
EvaluateFile(Interpreter As Long, FileName As String, CommandOutput As String, ErrorLine As Long) As Long
|
|
Input
|
The "Interpreter" parameter, which must be a valid interpreter pointer.
The "FileName" parameter, which contains the name of the file to evaluate.
|
|
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 is a wrapper around the Tcl_EvalFile function.
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 contain the result of the evaluation of ' the specified file psOutput = vbNullString plResult = poTcl.EvaluateFile(plInterpreter, "test1.tcl", psOutput, 0&) Call poTcl.DeleteInterpreter(plInterpreter) Set poTcl = Nothing End Sub |