[Gambas-user] Get Output of Shell or Exec in TextArea.

Willy Raets willy at ...2734...
Tue Mar 6 23:38:15 CET 2012


On di, 2012-03-06 at 14:14 -0800, Bill-Lancaster wrote:
> Good point, I'm using 3.0 and it works fine, I think that with Gambas2, I was
> using something like:
> 
> Public hProcess as process
> 
> hProcess=exec[.....] for read
> 
> sub hProcess_read
> .....
> end
> 
> hope this helps, if not, I'll see if I have some Gambas 2 code
> 
> Bill

Dim sText, sSqlite As String
'
'simple example using arch command
'try at command line to see the return
'
Exec["arch"] To sText
TextArea1.Text = Trim(sText)
'
'simple example using sqlite command
'try at command line to see the return
'
Exec ["sqlite", "-version"] To sSqlite
If Len(sSqlite) = 0
  TextAreaSqliteV.Text = Len(sSqlite)  'returns length 0
Else
  TextAreaSqliteV.Text  = Trim(sSqlite) 'returns version sqlite
Endif

I guess if the info is very long it night be possible exec directly into
the TextArea, never tried it before myself:

Exec[....] To TextArea1.Text

Give it a try.

Willy






More information about the User mailing list