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

Bill-Lancaster bill-lancaster at ...2231...
Tue Mar 6 08:46:40 CET 2012


This works,


Public Sub Form_Open()
Dim iIndex As Integer
     iIndex = FMain.GetIndex(sPID)
     If iIndex = 0 Then Return
     Inc Application.Busy
     Exec ["get_iplayer", "--info", iIndex, "--nocopyright"] For Read As
"Contents"
     Dec Application.Busy
End

Public Sub Contents_Read()
Dim sData As String, sLine As String, sName As String
Dim i As Integer, iPos As Integer, iPID As Integer
     Read #Last, sData, -255
     $sBuffer &= sData
     Do
          iPos = InStr($sBuffer, "\n")
          If iPos = 0 Then Break
          sLine = Left($sBuffer, iPos - 1)
          $sBuffer = Mid$($sBuffer, iPos + 1)
          If InStr(sLine, "name:") > 0 Then
               txbName.Text = Trim(Mid(sLine, 6))
          Endif
          sDisplay &= sLine & gb.NewLine
          TextArea1.Text = sDisplay
     Loop
End

Public Sub Contents_Kill()
     Dec Application.Busy
End

Regards

Bill Lancaster
-- 
View this message in context: http://old.nabble.com/Get-Output-of-Shell-or-Exec-in-TextArea.-tp33446832p33449189.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list