B4J Question list of lists?

zak

Member
Licensed User
Longtime User
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..
 

LucaMs

Expert
Licensed User
Longtime User
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)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…