B4X:
Sub Button1_Click
For i = 0 To 10
Log(i)
Wait For (test) Complete (result As String)'The process looks something like this.
Log(result)
Next
End Sub
Sub test() As ResumableSub
Dim http As HttpJob
http.Initialize("",Me)
http.Download("http://www.google.com")
' Some time-consuming operations.
Wait For (http) jobDone(http As HttpJob)
If http.Success Then
Return http.GetString
End If
Return ""
End Sub
我希望button_click中的循环等待"wait for"语句执行结果出来后再继续.这该怎么做?