C cloner7801 Active Member Licensed User Longtime User Dec 3, 2016 #1 Hi I use this for add record to map but it doesn't work https://www.b4x.com/android/forum/threads/addtomap.43937/#post-267500 I want to create a sub to add record to map I use : Code: Copy Sub AddToMap(ValueList As List) Dim KeyList As List = Array("name","type","ip") For i = 0 To KeyList.Size - 1 main.allkeys.Put(KeyList.Get(i), ValueList.Get(i)) Next End Sub But when I use this code Dim js As JSONGenerator js.Initialize(Main.allkeys) Log(js.ToString) its just show me last record! I think when I use put its delete previous record
Hi I use this for add record to map but it doesn't work https://www.b4x.com/android/forum/threads/addtomap.43937/#post-267500 I want to create a sub to add record to map I use : Code: Copy Sub AddToMap(ValueList As List) Dim KeyList As List = Array("name","type","ip") For i = 0 To KeyList.Size - 1 main.allkeys.Put(KeyList.Get(i), ValueList.Get(i)) Next End Sub But when I use this code Dim js As JSONGenerator js.Initialize(Main.allkeys) Log(js.ToString) its just show me last record! I think when I use put its delete previous record
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2016 #2 Not sure why you need such sub. Use: Code: Copy Dim allKeys As Map = CreateMap("name": ..., "type": ..., "ip": ...) If you still want to use it then please create a small project and upload it. Upvote 0
Not sure why you need such sub. Use: Code: Copy Dim allKeys As Map = CreateMap("name": ..., "type": ..., "ip": ...) If you still want to use it then please create a small project and upload it.