[tcljava-user] help - how to execute a tcl from java
Brought to you by:
mdejong
From: rohit <roh...@ya...> - 2007-10-01 08:00:21
|
good morning, am trying to execute a simple tcl script from a java stub. below is the java stub and the tcl script. i am able to execute the script. however, i need to get the results of the tcl script execution into a output stream / buffer in the calling java stub. i am not able to figure how this is done. please help ! any pointers/suggestions will be highly appreciated java stub : Interp interp = new Interp(); try { interp.evalFile("test.tcl"); System.out.println("running tcl done."); } catch (TclException ex) { // some exception handling } } finally { interp.dispose(); } test.tcl contents : set a 3 set b 4 set message "c = sqrt($a*$a+$b*$b) = [expr sqrt($a*$a+$b*$b)]" puts $message going, going, ... gone. --------------------------------- Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search. |