Hi Rohit,
When script is executed , each command is executed and
the result is stored in the interp , after the
execution of last command, the result of be will
streamed out.
If you want to print where ever you need then use
"puts [ yours command ]" which will print output of
"your command" on to the prompt..
hope this helps
mallick
--- tcl...@li... wrote:
> Send tcljava-user mailing list submissions to
> tcl...@li...
>
> To subscribe or unsubscribe via the World Wide Web,
> visit
>
>
https://lists.sourceforge.net/lists/listinfo/tcljava-user
> or, via email, send a message with subject or body
> 'help' to
> tcl...@li...
>
> You can reach the person managing the list at
> tcl...@li...
>
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of tcljava-user digest..."
>
>
> Today's Topics:
>
> 1. help - how to execute a tcl from java (rohit)
>
>
>
----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 1 Oct 2007 01:00:16 -0700 (PDT)
> From: rohit <roh...@ya...>
> Subject: [tcljava-user] help - how to execute a tcl
> from java
> To: tcl...@li...
> Message-ID:
> <966...@we...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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.
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2005.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
> ------------------------------
>
> _______________________________________________
> tcljava-user mailing list
> tcl...@li...
>
https://lists.sourceforge.net/lists/listinfo/tcljava-user
>
>
> End of tcljava-user Digest, Vol 16, Issue 1
> *******************************************
>
____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
|