[Gambas-user] Capturing or redirecting print output

GuruLounge - MailLists maillists at ...1367...
Wed Mar 29 18:30:39 CEST 2006


Well, I want to capture the standard output from my project directly.
Mainly because I shell out to other apps without using the "process"
object, also my project generates print messages on it's own.

Jeff

On Wed, 2006-03-29 at 10:14 -0500, Rob Kudla wrote:
> On Wed March 29 2006 02:06, GuruLounge - MailLists wrote:
> > Is there a way to redirect or capture the "print" standard
> > output so I can display it in a textarea?
> 
> It's definitely possible, but you would probably have to do 
> something complicated like create a named pipe and redirect the 
> output of your program to that pipe, then open that pipe in 
> Gambas and read from it to populate the text area.
> 
> Instead, I'd recommend writing a MyPrint method that handles 
> writing to the text area, so that it's a quick job to redirect 
> the output wherever you want rather than having to edit every 
> Print statement in your project.  You could just do one search 
> and replace and that would be the end of it (well, assuming 
> there are no Print # statements in your project.)
> 
> Rob
> 
> 

-- 

     .^.
     /V\
    /( )\
    ^^-^^
Linux Advocate





More information about the User mailing list