ianvirgo74
New Member
Hello All,
this is my program code
{code}
Dim ServerData As List
ServerData.Initialize
Wait For (GetDataFromJRDC()) Complete (ServerData As List)
Log("Data from server successfully retrieved:" & ServerData.Size)
For Each mData As Map In ServerData
Log("Username: " & mData.Get("username") & ", Last edit: " & mData.Get("last_edit"))
Next
Private Sub GetDataFromJRDC() As ResumableSub
Dim DataServer As List
DataServer.Initialize
Wait For (B4XPages.MainPage.jRDC.GetRecord("get_loginsync", Null)) Complete (Answer As Map)
If Answer.Get("Success") Then
Dim l As List
Dim rs As DBResult
rs = Answer.Get("Data")
l = rs. Rows
If l.Size > 0 Then
For Each row() As Object In l
Dim mData As Map
mData.Initialize
mData.Put("username", row(rs.Columns.Get("username")))
mData.Put("last_edit", row(rs.Columns.Get("last_edit")))
DataServer.Add(mData)
Next
End If
Otherwise
MsgboxAsync("An error occurred while connecting to the server: " & Answer.Get("Error"), "Failed")
End If
Return DataServer
End Sub
{/code}
So my question is, why does array expected appear in the logs?
even though when I compile, the program runs correctly without error and I can get the list of data I need
in the logs the expected array will appear when I write the code :Wait For (GetDataFromJRDC()) Complete (ServerData As List)
Is there @anyone who can help me?
this is my program code
{code}
Dim ServerData As List
ServerData.Initialize
Wait For (GetDataFromJRDC()) Complete (ServerData As List)
Log("Data from server successfully retrieved:" & ServerData.Size)
For Each mData As Map In ServerData
Log("Username: " & mData.Get("username") & ", Last edit: " & mData.Get("last_edit"))
Next
Private Sub GetDataFromJRDC() As ResumableSub
Dim DataServer As List
DataServer.Initialize
Wait For (B4XPages.MainPage.jRDC.GetRecord("get_loginsync", Null)) Complete (Answer As Map)
If Answer.Get("Success") Then
Dim l As List
Dim rs As DBResult
rs = Answer.Get("Data")
l = rs. Rows
If l.Size > 0 Then
For Each row() As Object In l
Dim mData As Map
mData.Initialize
mData.Put("username", row(rs.Columns.Get("username")))
mData.Put("last_edit", row(rs.Columns.Get("last_edit")))
DataServer.Add(mData)
Next
End If
Otherwise
MsgboxAsync("An error occurred while connecting to the server: " & Answer.Get("Error"), "Failed")
End If
Return DataServer
End Sub
{/code}
So my question is, why does array expected appear in the logs?
even though when I compile, the program runs correctly without error and I can get the list of data I need
in the logs the expected array will appear when I write the code :Wait For (GetDataFromJRDC()) Complete (ServerData As List)
Is there @anyone who can help me?