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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.