[Gambas-user] Redirect default output to terminalview

Brian G brian at westwoodsvcs.com
Tue Jan 28 00:20:26 CET 2020


I added those features quite a while ago in the form of the connect to, which is the last sution I sent




thank you


brian







On Mon, Jan 27, 2020 at 1:38 PM -0800, "gen braga" <genbraga1 at gmail.com> wrote:










Hi Brian

I was heading towards the same solution but thought it was too much
work for what I'm needing. By the way, it's a nice piece of code.

I kept so focused that I completely missed the Print method as Lee
pointed. Not happy with it also.

Maybe Benoit could point a better solution, or, who knows, it could be
a new  feature in the gb.form.terminal component... Just thinking.

Thanks for your help.

-

Gen

2020-01-27 17:50 GMT-03:00, Brian G :
> You can also use the connectTo method as follows which will give you input
> as well from the terminal
> It seems to still work in this version
>
> Public $Pipeout As File
> Public $MyPipeIn As File
> Public $MyPipeOut As File
> Private $PipeIn As File
>
>
> Public Sub Form_Open()
>
> outputterm.Show()
> outputterm.tv1.Show()
> Wait
>
> End
>
>
> Public Sub Button1_Click()
>
> Dim reader As String
> Print "Hello world"
>
> $PipeOut = Pipe "/tmp/xx" For Write
> $MyPipeOut = Pipe "/tmp/yy" For Write
>
> $PipeIn = Pipe "/tmp/xx" For Read
> $MyPipeIn = Pipe "/tmp/yy" For Read Watch
>
> outputterm.tv1.ConnectTo($MyPipeOut, $PipeIn, Null)
>
> Output To $PipeOut
>
> Print "hello"
> outputterm.tv1.Print("this")
> Wait
>
> Print "this is a good time for happy thoughts"
> Wait
>
> Print "This is the time to run"
> Wait
>
> End
>
> Public Sub Button2_Click()
>
> Print TextEditor1.text
>
> End
>
> Public Sub file_read()
>
> Debug "Read Called"
>
> Dim Buffer As String
> Read #$MyPipeIn, Buffer, -256
> Print Buffer
> Debug buffer
>
> End
>
> Thank You
> Brian G
>
>
> From: "gen braga" 
> To: "Gambas mailing list" 
> Sent: Monday, January 27, 2020 11:20:37 AM
> Subject: Re: [Gambas-user] Redirect default output to terminalview
>
>
>
>
>> Is It possible to redirect the default output (or even debug) to a
>> terminalview?
>
> The output of what? As far as I understand it, the output of any command
> executed in the TerminalView (.Shell or .Exec) will
> automatically be displayed in that view.
>
>
>
>
> As I said, the default (or debug) output. The one you get with
>
> Print "something"
>
> Or
>
> Debug "something"
>
> Instead of simply the output from .Shell or .Exec methods.
>
> The Print method can get the job done, but my goal was to redirect any
> "print". Like using the "OUTPUT TO" instruction.
>
> Anyway, thanks for your reply, I really missed the print method.
>
> -
> Gen
>
> BQ_BEGIN
>
> BQ_END
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>

----[ http://gambaswiki.org/wiki/doc/netiquette ]----





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200127/d6ae93b8/attachment.html>


More information about the User mailing list