Hi
I'm having some trouble with passing my list of objects from my datamanager class to my main module.
While i'm still in my datamanager i have no problem reading my list, but when i pass this list to my main module it becomes unreadable.
Code from my datamanager.
Code from my Main module
I'm having some trouble with passing my list of objects from my datamanager class to my main module.
While i'm still in my datamanager i have no problem reading my list, but when i pass this list to my main module it becomes unreadable.
Code from my datamanager.
B4X:
Sub GetClubs
Dim cursor1 As Cursor
Dim row As Int
Dim objClub As clsClub
Dim arClub As List : arClub.Initialize
Try
cursor1 = Main.sql1.ExecQuery("SELECT * FROM clubs ORDER BY clubNaam ASC")
If cursor1.RowCount > 0 Then
intRowNumber = cursor1.RowCount
For row = 0 To intRowNumber -1
cursor1.Position = row
objClub.ClubID = cursor1.GetInt("clubID")
objClub.ClubNaam = cursor1.GetString("clubNaam")
objClub.ClubGPS = cursor1.GetString("clubGPS")
arClub.Add(objClub)
Next
End If
Catch
Log(LastException.Message)
ToastMessageShow(LastException.Message, True)
End Try
Return arClub
End Sub
Code from my Main module
B4X:
Dim arClubs As List : arClubs.Initialize
arClubs = dmDataManager.GetClubs
Try
If arClubs.Size > 0 Then
For i = 0 To arClubs.Size -1
Dim objClub As clsClub = arClubs.Get(i)
spnClub.Add(objClub.ClubNaam)
Next
Else
spnClub.Enabled = False
End If
Catch
Log(LastException.Message)
ToastMessageShow(LastException.Message, True)
End Try