Tcl_eval File Example

Tcl Procedure ExampleTcl Scripts Examples

Tcl_Eval manual page - Tcl Library Procedures >>Eval Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA — execute Tcl scripts #include int Tcl_EvalObjEx( interp, objPtr, flags) int Tcl_EvalFile( interp, fileName) int Tcl_EvalObjv( interp, objc, objv, flags) int Tcl_Eval( interp, script) int Tcl_EvalEx( interp, script, numBytes, flags) int Tcl_GlobalEval( interp, script) int Tcl_GlobalEvalObj( interp, objPtr) int Tcl_VarEval( interp, part, part. (char *) NULL) int Tcl_VarEvalVA( interp, argList) Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA — execute Tcl scripts #include int Tcl_EvalObjEx( interp, objPtr, flags) int Tcl_EvalFile( interp, fileName) int Tcl_EvalObjv( interp, objc, objv, flags) int Tcl_Eval( interp, script) int Tcl_EvalEx( interp, script, numBytes, flags) int Tcl_GlobalEval( interp, script) int Tcl_GlobalEvalObj( interp, objPtr) int Tcl_VarEval( interp, part, part. (char *) NULL) int Tcl_VarEvalVA( interp, argList) *interp (in) Interpreter in which to execute the script. The interpreter's result is modified to hold the result or error message from the script. *objPtr (in) A Tcl value containing the script to execute. Int flags (in) ORed combination of flag bits that specify additional options.

TCL_EVAL_GLOBAL and TCL_EVAL_DIRECT are currently supported. Const char *fileName (in) Name of a file containing a Tcl script.

With this routine, one can read and evaluate the content of a file containing tcl/tk scripts. This allows to create powerful tk. Hex-dumping a file. The following example code opens a file, configures it to binary translation (i.e. Line-ends r n are not standardized to n as usual in C), and.

Int objc (in) The number of values in the array pointed to by objPtr; this is also the number of words in the command. **objv (in) Points to an array of pointers to values; each value holds the value of a single word in the command to execute. Int numBytes (in) The number of bytes in script, not including any null terminating character. If -1, then all characters up to the first null byte are used. Dazzle 6 In 1 Card Reader Drivers on this page.

Const char *script (in) Points to first byte of script to execute (null-terminated and UTF-8). Char *part (in) String forming part of a Tcl script. Va_list argList (in) An argument list which must have been initialized using va_start, and cleared using va_end. The procedures described here are invoked to execute Tcl scripts in various forms. Tcl_EvalObjEx is the core procedure and is used by many of the others. It executes the commands in the script stored in objPtr until either an error occurs or the end of the script is reached. If this is the first time objPtr has been executed, its commands are compiled into bytecode instructions which are then executed.