I have a sub that uses a resumable sub to fetch website data. As you cannot return a value from a resumable sub, how do I get the value of the website data out of the sub.
Here is my code:
Any assistance is appreciated
Here is my code:
B4X:
Private Sub mySub
FetchWebsite("https://duckduckgo.com", Array As String("q","test","t","hj","ia","web"))
Wait For FetchWebsite_Complete
'Somehow use myJob.GetString value
End Sub
Sub FetchWebsite(url As String, param() As String)
Dim myJob As HttpJob
myJob.Initialize("", Me)
myJob.Download2(url,param)
Wait For (myJob) JobDone (myJob As HttpJob)
If myJob.Success Then
Log(myJob.GetString)
Else
Log("Error: " & myJob.ErrorMessage)
End If
myJob.Release
CallSubDelayed(Me, "FetchWebsite_Complete")
'Somehow return myJob.GetString
End Sub
Any assistance is appreciated
Last edited: