Sub Process_Globals
dim t as timer
end sub
Sub AppStart (Form1 As Form, Args() As String)
t.Initialize("Timer",500)
' ...
end sub
Sub btnGO_Click
Dim args As List
args.Initialize
'args.Add("-oF")
'args.Add("GTIFF")
args.Add("-o")
args.Add(lblDest.Text)
For Each item As String In lv.Items
args.Add(item)
Next
shl.Initialize("shl", "gdal_merge.bat" , args)
shl.WorkingDirectory = "C:\OSGeo4W64\"
shl.Run(-1) ' No timeout- Let it run...
running = True
t.Enabled = True ' Timer enabled
End Sub
Sub Timer_Tick
' change the content of the memo field with the new temporary output
If running Then
memo.Text = shl.GetTempOut
End If
End Sub
Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
t.Enabled = False
running = False
If Success And ExitCode = 0 Then
Log("Success")
Log(StdOut)
memo.Text = StdOut
Else
Log("Error: " & StdErr)
memo.Text = StdErr
End If
End Sub