Thread: Re: [tcljava-user] Jacl documentation
Brought to you by:
mdejong
From: Wei D. <wd...@fn...> - 2006-11-22 19:26:34
|
HI Patrick, Thank you so much for the quick response, I have seen the http://tcljava.sourceforge.net/docs/TclJavaLib/contents.htm But it does not seem to be complete or very helpful. May be I am missing something here. I wanted to understand the Jacl threading module and how can I get STDOUT and STDERR using Jacl APIs.=20 I also wanted to know if Interp.GetResults can be the used as STDOUT or STDERR. I have noticed most time that it seems to be the STDOUT or STDERR, but it does not give me STDOUT when it comes to commands like puts.=20 My third question is: Does Jacl support cancel and timeout when it comes to Interp.eval APIs? Thanks a lot in advance, your advices are highly appreciated. Wei -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of Patrick Finnegan Sent: Wednesday, November 22, 2006 10:59 AM To: A list for users of tcljava Subject: Re: [tcljava-user] Jacl documentation On Wednesday 22 November 2006 17:58, Wei Dai wrote: > I am trying to find some documentation on Jacl but so far I am kind of > frustrated by the fact that the documentation of the API simply sucks. > Are there any documentation/tutorials/forums on JACL that you recommend? > > > > > Thanks, Apologies if you have already seen these. Documentation ****************** http://wiki.tcl.tk/1313 http://tcljava.sourceforge.net/docs/website/manual.html Examples:=09 ************* http://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=3DTclBlend Just ask the mailing list for examples of what you want to do? Regards. Patrick. ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDE V _______________________________________________ tcljava-user mailing list tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: Wei D. <wd...@fn...> - 2006-11-25 16:31:38
|
I am not planning to manipulate them; all I want is to be able to retrieve them since we wanted to provide a console log that display what user would see if they run tclsh directly. So if puts commands result only comes from the STDOUT, I need to a way to get it. Same for the STDERR, it seems to me that Interp.getResults can provide error message in the error case, but is it the same message that I would get from STDERR? Thanks and Happy Holidays :) -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of rahul Sent: Thursday, November 23, 2006 10:53 AM To: A list for users of tcljava Subject: Re: [tcljava-user] Jacl documentation Hi Wei [Wei Dai:] | I wanted to understand the Jacl threading module and how can I get | STDOUT and STDERR using Jacl APIs.=20 Please do explain what you intend to do with STDERR and STDOUT, they are used by the tcl commands to print the results, and I am not sure how you are planning to manipuate them. How ever, if you are planning to capture the results of an expression evaluation, then Interp.getResult should give you the result. If you are checking for any exceptions, just catching the TclException and checking the Interp.getResult should give you the exception raised. (check the Shell.java for example on using it.) | I also wanted to know if Interp.GetResults can be the used as STDOUT or | STDERR. I have noticed most time that it seems to be the STDOUT or | STDERR, but it does not give me STDOUT when it comes to commands like | puts.=20 If you are familiar with java, puts behaves similar to System.out.println (by default with out a channel) while the Interp.getResult gives you the value of an expression evaluated. (like that of a function call in java.) rahul ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDE V _______________________________________________ tcljava-user mailing list tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcljava-user |
From: rahul <Rah...@Su...> - 2006-11-27 16:08:59
|
[Wei Dai:] | I am not planning to manipulate them; all I want is to be able to | retrieve them since we wanted to provide a console log that display what | user would see if they run tclsh directly. So if puts commands result | only comes from the STDOUT, I need to a way to get it. Same for the | STDERR, it seems to me that Interp.getResults can provide error message | in the error case, but is it the same message that I would get from | STDERR? The interp.getResults will not give you the output from puts command. it contains only the results of a function call/expression evaluation. which is different from writing to stdstreams. to capture the error information, this is what is done in the Shell, try { ...cmd evaluation.. } catch (TclException e) { switch (e.getCompletionCode()) { case TCL.ERROR println(errstream, interp.getResult().toString()) } } so yes, it is the same message. You can capture the puts output by changing the stdstreams in java. Take a look at extras/GuiShell/GuiShell.java: setupStreamReaders. You can see how the streams are diverted. |
From: James G. <jg...@mo...> - 2006-11-27 17:01:46
|
Hi Wei Dai, A simple approach, would be to change the System.out and System.err PrintStream objects through the static methods System.setOut and System.setErr respectively. This will allow you to provide a console log for your entire application. Regards, James Graham > Message: 1 > Date: Sat, 25 Nov 2006 08:31:30 -0800 > From: "Wei Dai" <wd...@fn...> > Subject: Re: [tcljava-user] Jacl documentation > To: "A list for users of tcljava" <tcl...@li...> > Message-ID: <619...@ff...> > Content-Type: text/plain; charset="us-ascii" > > I am not planning to manipulate them; all I want is to be able to > retrieve them since we wanted to provide a console log that display what > user would see if they run tclsh directly. So if puts commands result > only comes from the STDOUT, I need to a way to get it. Same for the > STDERR, it seems to me that Interp.getResults can provide error message > in the error case, but is it the same message that I would get from > STDERR? > > Thanks and Happy Holidays :) > |
From: rahul <Rah...@Su...> - 2006-11-23 18:58:36
|
Hi Wei [Wei Dai:] | I wanted to understand the Jacl threading module and how can I get | STDOUT and STDERR using Jacl APIs. Please do explain what you intend to do with STDERR and STDOUT, they are used by the tcl commands to print the results, and I am not sure how you are planning to manipuate them. How ever, if you are planning to capture the results of an expression evaluation, then Interp.getResult should give you the result. If you are checking for any exceptions, just catching the TclException and checking the Interp.getResult should give you the exception raised. (check the Shell.java for example on using it.) | I also wanted to know if Interp.GetResults can be the used as STDOUT or | STDERR. I have noticed most time that it seems to be the STDOUT or | STDERR, but it does not give me STDOUT when it comes to commands like | puts. If you are familiar with java, puts behaves similar to System.out.println (by default with out a channel) while the Interp.getResult gives you the value of an expression evaluated. (like that of a function call in java.) rahul |