[vtkusers] Help with tcl interpreter

shahid shahed at isb.paknet.com.pk
Wed Jul 30 01:22:27 EDT 2003


the Result/Output are i think coming from ur 1st "if" construct that is not
an error. That is why the 2nd "if" block is not executed.

Now the result "[no library has been specified for Tcl]" probably indicate
that tcl library path is not correct.

have you set the TCLLIBPATH environment parameter? Here is an example.

TCLLIBPATH="C:/vtk42/bin/Tcl" "C:/vtk42/bin" "C:/Tcl/lib/tcl8.3"
"C:/Tcl/lib" "
C:/Tcl/lib/tcllib1.1"

try this and doing init.tcl, hopefully it will solve your problem.

shahid

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org]On Behalf Of
Johanna
Sent: Tuesday, July 29, 2003 6:52 PM
To: vtkusers at vtk.org
Subject: RE: [vtkusers] Help with tcl interpreter


This is part of my code and the result:

Code:
  Tcl_Interp *tclinterp;
  tclinterp = Tcl_CreateInterp();

  eval=Tcl_GlobalEval(tclinterp,"info library");

  if (tclinterp->result != 0) {
    printf("Test [%s]\n", tclinterp->result);
  }

  if (eval==TCL_ERROR) {
    printf("eval=[%d]\n", eval);
    return TCL_ERROR;
  }

Result/Output:
  Test [no library has been specified for Tcl]

So I guess my libraries are not loaded ok. However I still get a TCL_ERROR
from Tcl_GlobalEval so it seems that not even the line
'Tcl_GlobalEval(tclinterp,"info library")' is ok.

I tried to do 'Tcl_EvalFile(tclinterp, "/usr/lib/tcl8.3/init.tcl")' but
since all Tcl_EvalFile, Tcl_GlobalEval etc generates a TCL_ERROR I do not
think it worked.

/Johanna

-----Original Message-----
From: "shahid" <shahed at isb.paknet.com.pk>
To: <vtkusers at vtk.org>
Date: Tue, 29 Jul 2003 17:24:38 +0500
Subject: RE: [vtkusers] Help with tcl interpreter


You probably need to first check that you Interp process is initialized
properly
	code=Tcl_Eval(tclinterp,"info library"); # returned path must include path
to vtk files
                                               #else "package require vtk"
shall fail
doing
	Tcl_EvalFile(tclinterp, "your_tcllibpath/init.tcl"); # may help to
initialize the interpreter properly

Hope this shall solve your problem.

shahed

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org]On Behalf Of
Johanna
Sent: Tuesday, July 29, 2003 12:38 PM
To: vtkusers at vtk.org
Subject: [vtkusers] Help with tcl interpreter


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

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list