Did you try the errorInfo variable? I seem to remember a patch provided
by Harald Kirsch that fixed the exact problem you describe (using the
evalFile() method and getting the error info). Look in the changes file
for the change "1/7/99 (line numbers in interp.evalFile() method)".
You should be able to call interp.getVar("errorInfo", null,
TCL.GLOBAL_ONLY) to get this value.
later
mo
On Tue, 15 Jun 1999, Stillwell, Chris wrote:
> I am evaluating a script file from within a Java program by creating a new
> Interp and invoking evalFile. The script may also invoke other script files
> using the source command. If an error is detected in any of the scripts a
> TclException is thrown, caught, and the stack trace printed. However, this
> is the Java stack trace which leaves me clueless as to what line within what
> script actually failed. Any guidance will be appreciated.
>
> Interp interp = new Interp();
> try {
> interp.evalFile(script);
> interp.dispose();
> } catch (TclException e) {
> ...
> }
>
>
> Completion Code: TCL.ERROR
> Result: missing close-brace
> tcl.lang.TclException
> at tcl.lang.Parser.eval2(Parser.java:1095)
> at tcl.lang.Interp.eval(Interp.java:1781)
> at tcl.lang.Interp.evalFile(Interp.java:1879)
> at tcl.lang.SourceCmd.cmdProc(SourceCmd.java:75)
> at tcl.lang.Parser.evalObjv(Parser.java:740)
> at tcl.lang.Parser.eval2(Parser.java:1138)
> at tcl.lang.Interp.eval(Interp.java:1781)
> at tcl.lang.Interp.eval(Interp.java:1840)
> at tcl.lang.IfCmd.cmdProc(IfCmd.java:57)
> at tcl.lang.Parser.evalObjv(Parser.java:740)
> at tcl.lang.Parser.eval2(Parser.java:1138)
> at tcl.lang.Procedure.cmdProc(Procedure.java:175)
> at tcl.lang.Parser.evalObjv(Parser.java:740)
> at tcl.lang.Parser.eval2(Parser.java:1138)
> at tcl.lang.Interp.eval(Interp.java:1781)
> at tcl.lang.Interp.eval(Interp.java:1840)
> at tcl.lang.IfCmd.cmdProc(IfCmd.java:57)
> at tcl.lang.Parser.evalObjv(Parser.java:740)
> at tcl.lang.Parser.eval2(Parser.java:1138)
> at tcl.lang.Interp.eval(Interp.java:1781)
> at tcl.lang.Interp.evalFile(Interp.java:1879)
> at
> com.eds.lif.codegen.CodeGenerator.runScript(CodeGenerator.java:252)
> at com.eds.lif.codegen.CodeGenerator$1.run(CodeGenerator.java:231)
>
> ----------------------------------------------------------------
> The TclJava mailing list is sponsored by WebNet Technologies.
> To subscribe: send mail to [EMAIL PROTECTED]
> with the word SUBSCRIBE as the subject.
> To unsubscribe: send mail to [EMAIL PROTECTED]
> with the word UNSUBSCRIBE as the subject.
> To send to the list, send email to '[EMAIL PROTECTED]'.
> A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>
----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
A list archive is at: http://www.findmail.com/listsaver/tcldallas/