[Gambas-user] Redirect default output to terminalview

Brian G brian at westwoodsvcs.com
Mon Jan 27 21:50:58 CET 2020


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" <genbraga1 at gmail.com> 
To: "Gambas mailing list" <user at lists.gambas-basic.org> 
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 ]---- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200127/494c7ed0/attachment.html>


More information about the User mailing list