Hi,
I´m struggling with the concept of (fake)asynchronous tasks. What is the right way to deal with it?
That´s what I´m doing right now (Simplified for testing):
Sub SetText(t As Int)
Log("SetText: " & t)
Label1.Text = "Count: " &t
End Sub
Sub Run
For i=0 To 10
Log("Run" & i)
CallSubDelayed2(Me,"SetText", i )
Next
End Sub
Sub BtnStart_Click
For i=0 To 100
Log("Click: " & i)
CallSubDelayed(Me, "Run")
Next
End Sub
I read several times from Erel to split up larger tasks to smaler ones and use CallSubDelayed to call them.
I´m as well doing this in the Main Task right now.
The result is right now:
I geht 100 times the Log("Click") and then the Log ("Run").
After all is finished, the Label jumps to "Count: 10" (obviously)
So, what I am doing wrong? In Android I would use DoEvents but that does not exist in iOS. What is the right way to deal with it?
i would be really happy if someone cold point me in the right direction.
Thanks for your help
Andreas
Attached the Test Project.