Re: [tcljava-user] HELP...Calling TCL scripts from a Java program
Brought to you by:
mdejong
|
From: Mo D. <md...@cy...> - 2001-05-12 20:35:04
|
On Sat, 12 May 2001, Tam Huynh wrote:
> ok, i'm trying the other approach by using the binary version of Jacl 1.2.6.
> i'm trying to call the tcl script as describe below..am i missing any kind
> of patch for jacl? both tcljava.jar and jacl.jar are on my classpath and
> i'm using Forte for Java 1.0. i know the interp object is created bc it's
> fine when i type newInterp.eval("puts {hello there}"), but doesn't invoke my
> script when i use "source"..
>
> ERRORS:
>
> tcl.lang.TclVarException
> tcl.lang.TclVarException
> at tcl.lang.Var.lookupVar(Var.java)
> at tcl.lang.Var.getVar(Var.java)
> at tcl.lang.Parser.evalTokens(Parser.java)
> at tcl.lang.Parser.eval2(Parser.java)
> at tcl.lang.Interp.eval(Interp.java)
> at tcl.lang.Interp.evalFile(Interp.java)
> at tcl.lang.SourceCmd.cmdProc(SourceCmd.java)
> at tcl.lang.AutoloadStub.cmdProc(Extension.java)
> at tcl.lang.Parser.evalObjv(Parser.java)
> at tcl.lang.Parser.eval2(Parser.java)
> at tcl.lang.Interp.eval(Interp.java)
> at tcl.lang.Interp.eval(Interp.java)
> at com.nwoods.jgo.examples.demo1.Demo1.main(Demo1.java:1006)
>
>
> JAVA PROGRAM:
> import tcl.lang.*;
>
>
>
> public static void main(String args[])
> {
> try
> {
> Interp newInterp = new Interp();
> newInterp.eval("source d:/Tcl83/bin/hello.tcl");
> newInterp.dispose();
> }
> catch (Throwable t)
> {
> System.err.println(t);
> t.printStackTrace();
> //Ensure the application exits with an error condition.
> System.exit(1);
> }
> }
Well, I don't know why running the source command would
do that. It is running Interp.evalFile() which should
eval the contents of the file. Could you poke around in
a debugger to find out why this variable error is being
generated? Is your script using a variable that is
not set?
Mo
|