Hello, is it possible to create a list of lists, where every member of the list is a also a list? I think that an array of lists can be used (Public en_approximative_list(100) As List) but I don't know the number of items in advance..
A list can hold any type of objects including other lists.
B4X:
Dim MainList As List
MainList.Initialize
For i = 1 to 100
Dim l As List
l.Initialize
l.Add(i)
MainList.Add(l)
Next
Dim l As List = MainList.Get(54)
Log(l)
In some (many?) cases you could also store Lists in a Map; this way you can index the lists by their name.
B4X:
Dim lstNameXXX As List
...
...
mapLists.Put("ListNameXXX", lstNameXXX)
Dim lstNameABC As List
...
...
mapLists.Put("ListNameABC", lstNameABC)
Dim ListName As String
ListName = "ListNameXXX"
Dim lstCurrent As List = mapLists.Get(ListName)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.