BarryW Active Member Licensed User Longtime User Mar 3, 2015 #1 Hi masters is there any way how to insert a set of map into a list as object B4a accepts list to map but how do it vice versa? Code: Dim list1 as List Dim map1 as map = list1 To Code: Dim map1 as Map Dim list1 as List List1.AddAll(m) is it possible? Tnx!!!
Hi masters is there any way how to insert a set of map into a list as object B4a accepts list to map but how do it vice versa? Code: Dim list1 as List Dim map1 as map = list1 To Code: Dim map1 as Map Dim list1 as List List1.AddAll(m) is it possible? Tnx!!!
eurojam Well-Known Member Licensed User Longtime User Mar 3, 2015 #2 may be there are other solutions which are smarter then this: Code: Dim map1 As Map Dim list1 As List Dim mypanel As Panel mypanel.Initialize("P") list1.Initialize map1.Initialize map1.Put(1,"Hello World") map1.put(2,mypanel) list1.Add(0) For Each v As Object In map1.Values Log(v) list1.Add(v) Next Log(list1.Size) Upvote 0
may be there are other solutions which are smarter then this: Code: Dim map1 As Map Dim list1 As List Dim mypanel As Panel mypanel.Initialize("P") list1.Initialize map1.Initialize map1.Put(1,"Hello World") map1.put(2,mypanel) list1.Add(0) For Each v As Object In map1.Values Log(v) list1.Add(v) Next Log(list1.Size)
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2015 #3 What exactly are you trying to add? If you want to add all the values then you should use @eurojam code. However you can just add the Map object to the list: Code: list1.Add(map1) Upvote 0
What exactly are you trying to add? If you want to add all the values then you should use @eurojam code. However you can just add the Map object to the list: Code: list1.Add(map1)