#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
Sub Process_Globals
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub Service_Destroy
End Sub
Sub LongLoop
Dim limit As Long = 1000000000
Dim refreshrate As Int = 500000
Dim barvalue As Int = 0
For x = 0 To limit
' Work code goes here
' ...
' ...
' ...
' Update progressbar with desired refresh rate
If (x mod refreshrate) = 0 Then
barvalue = barvalue + 1
If barvalue > 100 Then barvalue = 0
CallSub2(Main, "ProgressBar_Update", barvalue)
DoEvents
Log(barvalue)
End If
Next
CallSub2(Main, "ProgressBar_Update", 100)
ToastMessageShow("LOOP COMPLETE", True)
End Sub