modiran_ghaneipour
Member
hello
i use wait for in other module
if i use this code in root of each page, it work true
but if i copy this code in "Code Module" class it told cannot use wait in static function
"Error description: Static code modules cannot handle events."
plz help
thanks
i use wait for in other module
B4X:
public Sub sendToUrl( url As String ) As ResumableSub
'Log(Sender.As(B4XPagesManager.GetPageInfoFromRoot.B4XPage.))'
LogColor(DateTime.Now,Colors.Magenta)
Dim j1 As HttpJob
j1.Initialize("", Sender)
j1.Download(url)'"https://www.google.com")
Wait For (j1) JobDone(j As HttpJob)
If j .Success Then
Dim str1 As String =j.GetString
LogColor(str1,Colors.RGB(45,45,45))
Else
LogColor("Error..",Colors.Red)
End If
j.Release
LogColor(DateTime.Now,Colors.Blue)
Return False'
End Sub
if i use this code in root of each page, it work true
but if i copy this code in "Code Module" class it told cannot use wait in static function
"Error description: Static code modules cannot handle events."
plz help
thanks