iOS Question Difference between B4A and B4i Resumable Subs?

CaptKronos

Active Member
Licensed User
Longtime User
I am getting up to speed with B4i and as part of that process I have started porting a B4A app to B4i. I have been extremely impressed by the compatibility between the two platforms but have just noticed this curiosity.

In B4A clicking Button1 and Button2 produces the output that I would expect (i.e. "call sub", stream of numbers and then "returned from sub"). However, with B4i, Button2 doesn't seem to return from the call to testSubWithSleep and "returned from sub" isn't output.

B4X:
Sub Button1_Click
    Log("call sub")
    wait for (testSubWithSleep) complete  (Result As Boolean)
    Log("returned from sub")
End Sub

Sub Button2_Click
    Log("call sub")
    wait for (testSubWithSleep) complete 
    Log("returned from sub")
End Sub

Sub testSubWithSleep As ResumableSub
    For i=1 To 10
        Log(i)
        Sleep(300)
    Next
    Return True
End Sub

Maybe it's lazy programming but if I'm not interested in the returned value I sometimes (with B4A) don't bother with the "(Result as Boolean)" part of the "wait for" structure.

Am I missing something, apart from B4i being less forgiving that B4A?
 
Top