that seems to work, thanks for your help..
-----Original Message-----
From: tcl...@li...
[mailto:tcl...@li...]On Behalf Of Mo DeJong
Sent: Sunday, June 24, 2001 4:14 PM
To: tcl...@li...
Subject: Re: [tcljava-user] exec question
On Sat, 23 Jun 2001, Tam Huynh wrote:
> How do i go about getting the return value from executing the exec command
> in jacl? I have try the following in the tclsh which work but doesn't
work
> in my java program..
>
> shell:
> catch {exec tclsh83 script.tcl} s
> puts $s
>
>
> java:
> Interp interp = new Interp();
> String testing = "set res [exec tclsh83 D:/Tcl83/bin/scripts/script.tcl]";
> interp.eval(testing);
> interp.eval("puts $res");
Well, that should work. Here are the results I get with Jacl 1.3
from the CVS.
$ make shell
% set res [catch {exec false} s]
1
% set res
1
% set s
child process exited abnormally
% set res [catch {exec echo hi} s]
0
% set s
hi
Perhaps the fact that you left the catch out is raising
a TclException and your Java code fails to catch it.
Mo DeJong
Red Hat Inc
_______________________________________________
tcljava-user mailing list
tcl...@li...
http://lists.sourceforge.net/lists/listinfo/tcljava-user
|