R Ramezanpour Active Member Licensed User Longtime User Apr 23, 2015 #1 Hi there, I want to read list from map my map is : m=File.ReadMap(File.DirDocuments,"b") m is : (MyMap) {6, 1} And how to I read this and set it in list ? Last edited: Apr 24, 2015
Hi there, I want to read list from map my map is : m=File.ReadMap(File.DirDocuments,"b") m is : (MyMap) {6, 1} And how to I read this and set it in list ?
Erel B4X founder Staff member Licensed User Longtime User Apr 24, 2015 #2 Not sure that I understand. Did the original map had a List inside? Upvote 0
R Ramezanpour Active Member Licensed User Longtime User Apr 24, 2015 #3 Erel said: Not sure that I understand. Did the original map had a List inside? Click to expand... I write to map with : Dim m1 As Map m1.Initialize m1.Put(ID) File.WriteMap(file.DirDocuments,"b",m1) Upvote 0
Erel said: Not sure that I understand. Did the original map had a List inside? Click to expand... I write to map with : Dim m1 As Map m1.Initialize m1.Put(ID) File.WriteMap(file.DirDocuments,"b",m1)
R Ramezanpour Active Member Licensed User Longtime User Apr 26, 2015 #5 Erel said: What is ID? Click to expand... bk is code module I want to add to bookmark bk : Sub addb(ID As String) Dim m1 As Map m1.Initialize If File.Exists(File.DirDocuments,"b") = True Then m1 = File.ReadMap(File.DirDocuments,"b") End If m1.Put(ID) File.WriteMap(File.DirDocuments,"b",m1) End Sub Sub CheckExistBk(ID As String) As Boolean Dim m1 As Map m1.Initialize If File.Exists(File.DirDocuments,"b") = False Then Return False m1 = File.ReadMap(File.DirDocuments,"b") Return m1.ContainsKey(ID) End Sub ---- add to bookmark : Sub star4_click If bk.CheckExistBookmark(ID) = False Then bk.Addb(ID) Log("Add") End If End Sub Upvote 0
Erel said: What is ID? Click to expand... bk is code module I want to add to bookmark bk : Sub addb(ID As String) Dim m1 As Map m1.Initialize If File.Exists(File.DirDocuments,"b") = True Then m1 = File.ReadMap(File.DirDocuments,"b") End If m1.Put(ID) File.WriteMap(File.DirDocuments,"b",m1) End Sub Sub CheckExistBk(ID As String) As Boolean Dim m1 As Map m1.Initialize If File.Exists(File.DirDocuments,"b") = False Then Return False m1 = File.ReadMap(File.DirDocuments,"b") Return m1.ContainsKey(ID) End Sub ---- add to bookmark : Sub star4_click If bk.CheckExistBookmark(ID) = False Then bk.Addb(ID) Log("Add") End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Apr 27, 2015 #6 Please use [code]code here...[/code] tags when posting code. I'm still not sure that I understand the question correctly. However try to use KeyValueStore class: https://www.b4x.com/android/forum/threads/class-keyvaluestore.46558/#content It allows you to save objects instead of strings. Upvote 0
Please use [code]code here...[/code] tags when posting code. I'm still not sure that I understand the question correctly. However try to use KeyValueStore class: https://www.b4x.com/android/forum/threads/class-keyvaluestore.46558/#content It allows you to save objects instead of strings.