[vtkusers] Help with tcl interpreter

Johanna pettersson.johanna at home.se
Tue Jul 29 03:38:04 EDT 2003


Hello

I am trying to use Tcl_Interp and Tcl_EvalFile to evaluate a tcl script from a c++ file. My code looks like this: 

Tcl_Interp *tclinterp;
tclinterp = Tcl_CreateInterp();

int code = Tcl_EvalFile(tclinterp, "myTclScript.tcl");
  
if (code!=TCL_OK) {
  return TCL_ERROR;
}

The problem is that Tcl_EvalFile is never TCL_OK and always returns an error, i.e. myTclScript.tcl can not be evaluated. When my tcl script has been run by the interpreter I would like to access some actors generated in the tcl script.

Does anyone have any experience on this and can see what I am doing wrong?

Sincerely
Johanna




More information about the vtkusers mailing list