Code flow for B4xMainPage(对于B4xMainPage的执行流程我无法掌控)

hzq200409

Member
Licensed User
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
I expect the loop to continue after the "log (Result)" execution.How do you do that?
我希望button_click中的循环等待"wait for"语句执行结果出来后再继续.这该怎么做?
 

hzq200409

Member
Licensed User
Your code will continue and make the downloads one by one. If you want all downloads to be done in parallel then call 'test' without Wait For.
It seems that neither of the two situations you mentioned can meet my needs.
Here is my project file:
 

Attachments

  • help.zip
    259.9 KB · Views: 251

hzq200409

Member
Licensed User
Your code will continue and make the downloads one by one. If you want all downloads to be done in parallel then call 'test' without Wait For.
I actually want to modify the "comment" on this XML and generate a new XML file.
 
Top