Hmmm... seem like you need to wait for the execution of the commands. Try:
Public Sub Main() > Dim fajl As File > Dim tovabb As Boolean > Dim i As Integer > $hProcess = Exec ["bash", "--noediting"] For Input Output As "Process" > tovabb = Run_command("ftp") > tovabb = Run_command("open") > tovabb = Run_command("ftp.mysite.com") > tovabb = Run_command("myusername") > tovabb = Run_command("mypassword") > tovabb = Run_command("ls ./public_html -R") > Wait 1 Or implement more intelligent method to wait something to appear to read event. This isn't necessary: > fajl = Open User.Home & "/Csabax.txt" For Create > Close (fajl) > Instead use this: fajl = Open User.Home & "/Csabax.txt" For Write Create > For i = 0 To answers.Max > Print #fajl, answers[i] > Next > Close (fajl) > This kills the process before commands are executed: $hProcess.Kill > Instead of this: > Public Sub Process_Read() > Dim sStr As String > Read #$hProcess, sStr, -256 > $sText = sStr > answers.Add($sText) > End > Use this: Public Sub Process_Read() Dim sStr As String Read #$hProcess, sStr, -256 answers.Add(sStr) End Because otherwise, you can lose message written to $sText in error event. Instead of this: Public Sub Process_Error(sStr As String) > > $sText = $sText & sStr > > End > > Use this: Public Sub Process_Error(sStr As String) answers.Add(sStr) End Hope this helps. Jussi ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user