'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Dim shl As Shell
If File.Exists("/home/pi/MyApps/Domo","Webcam.jpg") = True Then
File.Delete("/home/pi/MyApps/Domo","Webcam.jpg")
End If
shl.Initialize("shl", "/usr/bin/fswebcam", Array As String("-r 800*600"," -s 2","--no-banner", " /home/pi/MyApps/Domo/Webcam.jpg"))
shl.Run(10000) 'set a timeout of 10 seconds
StartMessageLoop 'need to call this as this is a console app.
End Sub
Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
If Success AND ExitCode = 0 Then
Log("Success")
Log(StdOut)
Else
Log("Error: " & StdErr)
End If
ExitApplication
End Sub