Android Question Map lists

Michael Mejias

Member
Licensed User
Longtime User
here is my code:

Dim JSONList As List
JSONList.Initialize

Dim ZeileMap As Map
ZeileMap.Initialize

ZeileMap.Put("test","1")
ZeileMap.Put("test2","2")
JSONList.Add(ZeileMap)

ZeileMap.Clear

ZeileMap.Put("test","3")
ZeileMap.Put("test2","4")
JSONList.Add(ZeileMap)

Msgbox(JSONList,"")



and the output is:

(ArrayList)[{test=3,test2=4},{test=3,test2=4}]

I know that using put replaces the previous key value if exists, my question is, is the replacement affects all in the list?

please help. thanks!.
 

DonManfred

Expert
Licensed User
Longtime User
Instead of clearing the map you should create a new instance (dim) of the map an add this then.
 
Upvote 0
Top