33. Evaluating Tcl Code

This chapter illustrates how to evaluate Tcl scripts from your C code, as well as Tcl math expressions.

33.1 Functions Presented in This Chapter

int Tcl_EvalObjEx(Tcl_Interp *interp,            Tcl_Obj *objPtr, int flags)

Evaluates a Tcl script contained in an object.

int Tcl_EvalFile(Tcl_Interp *interp,            CONST char *fileName)

Evaluates a Tcl script in a file given by fileName.

int Tcl_EvalObjv(Tcl_Interp *interp, int objc,            Tcl_Obj **objv, int flags)

Executes a single preparsed command instead of a script. The objc and objv arguments contain the values of the words for the Tcl command, one word in each object in objv.

int Tcl_Eval(Tcl_Interp *interp, CONST char *script)

Evaluates script

Get Tcl and the Tk Toolkit, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.