Sub Class_Globals
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
GetAndSetData
End Sub
Sub GetAndSetData
ProgressDialogShow2("please wait ...",True)
Dim remotehostjob As HttpJob
remotehostjob.Initialize("remote_host",Me)
remotehostjob.Download("http://www.xxxxxxxxxx.php?action=yyy")
Wait For (remotehostjob) JobDone(remotehostjob As HttpJob)
If remotehostjob.Success Then
Dim res As String = remotehostjob.GetString
LogColor("Back from JobName:" & remotehostjob.JobName ,0xFFD2691E)
LogColor("Response from server: " & res ,0xFFD2691E)
'
Dim parser As JSONParser
parser.Initialize(res)
Dim map1 As Map = parser.NextObject 'is a map
Main.ListDataModule1 = map1.Get("xyz") 'is a list
Else
Main.ListDataModule1 .Clear
End If
remotehostjob.Release
ProgressDialogHide
End Sub