Obviously I'm trying to learn about B4J.
How do you use ResumableSub in a Non-UI app?
This is the code that doesn't work for me:
What is it that I don't understand?
Thank you.
How do you use ResumableSub in a Non-UI app?
This is the code that doesn't work for me:
B4X:
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Log("before")
Wait For (Test) Complete (Finish As Boolean)
Log("after")
StartMessageLoop
End Sub
Sub Test As ResumableSub
For i = 1 To 60
Log(i)
Sleep(20) '<<-- Displaying Only First i=1
Next
Log("For/Next Finished")
StopMessageLoop
Return True
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
What is it that I don't understand?
Thank you.