[Gambas-user] Capturing or redirecting print output

Benoit Minisini gambas at ...1...
Wed Mar 29 18:55:38 CEST 2006


On Wednesday 29 March 2006 18:36, Rob Kudla wrote:
> On Wed March 29 2006 11:30, GuruLounge - MailLists wrote:
> > 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.
>
> I think the named pipe thing might be the best you can do, then
> (and I'm not sure it'll catch your child processes' output.)
> I'm not even sure it would work, it just is the first thing I
> thought of doing.
>
> Rob
>

Maybe something like:

hPipe = PIPE Temp$() FOR READ WRITE WATCH
OUTPUT TO hPipe

...

OUTPUT TO DEFAULT

...

PUBLIC SUB File_Read()

  DIM sStr AS String

  READ #LAST, sStr, -256
  ' Put sStr where you want...

END

-- 
Benoit Minisini





More information about the User mailing list