Tobias, Thanks for your example. I've now got the Exec's termination working OK. Below is an extract from my code: Private aExec As String[] Private sOutput As String Private hffmpeg As Process hffmpeg = Exec aExec Wait For Input Output As "ffmpegMessages" Public Sub ffmpegMessages_Read() Dim sLine As String Read #Last, sLine, -256 sOutput &= sLine End Public Sub ffmpegMessages_Kill() Print "ffmpeg Output = " Print sOutput End Public Sub ButtonStop_Click() If hffmpeg.State = Process.Running Then Print #hffmpeg, "q"
At run time: 1. aExec was equal to ["ffmpeg", "-f x11grab",.....]. Thus, the first parameter was "-f x11grab") which was displayed by ffmpeg as unrecognised (even though running "ffmpeg -f x11grab ......." is OK. The setting of the value in aExec was done by: aExec = ["ffmpeg"] aExec.Add("-f x11grab") etc I think that I've seen something like this before with Exec but I don't remember the reason or solution. Any ideas? 2. The Kill routine above was executed. At run time, there was an error caused by the last line being: If hffmpeg and hffmpeg.State = Process.Running Then Print #hffmpeg, "q" So I removed the first hffmpeg & it was OK at runtime. 3. I wanted to incorporate: Public Sub ffmpegMessages_Error(sError) Print "ffmpeg Error = " Print sError End but the compiler objected. Any ideas? -- Regards, John ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user