mangojack Expert Licensed User Longtime User Mar 3, 2013 #1 I was looking to the Map object to save app settings (4 settings) Just wish to confirm that if I initially write say 3 settings to file, B4X: m.Put("Key1", "Aaa") m.Put("Key2","Bbb") m.Put("Key3", "Ccc") File.WriteMap(File.DirDefaultExternal, "settings.txt", m) and later write a 4th key by itself .. ie B4X: m.Put("Key4", "Ddd") File.WriteMap(File.DirDefaultExternal, "settings.txt", m) I have in fact overwritten the first three keys , and that all WriteMap methods would have to be for the entire key / value set Many thanks Cheers mj
I was looking to the Map object to save app settings (4 settings) Just wish to confirm that if I initially write say 3 settings to file, B4X: m.Put("Key1", "Aaa") m.Put("Key2","Bbb") m.Put("Key3", "Ccc") File.WriteMap(File.DirDefaultExternal, "settings.txt", m) and later write a 4th key by itself .. ie B4X: m.Put("Key4", "Ddd") File.WriteMap(File.DirDefaultExternal, "settings.txt", m) I have in fact overwritten the first three keys , and that all WriteMap methods would have to be for the entire key / value set Many thanks Cheers mj
Theera Expert Licensed User Longtime User Mar 3, 2013 #2 Hi mangojack, I think that your project could use Erel's KeyValueStore,Right? Upvote 0
mangojack Expert Licensed User Longtime User Mar 3, 2013 #3 Thanks Theera .. yes I was looking at KeyValueStore . Although the app settings would be rarely changed (db create and delete) a map might be sufficient for now, but in the future maybe more settings and using a Map might become a problem. Cheers mj Upvote 0
Thanks Theera .. yes I was looking at KeyValueStore . Although the app settings would be rarely changed (db create and delete) a map might be sufficient for now, but in the future maybe more settings and using a Map might become a problem. Cheers mj
Erel B4X founder Staff member Licensed User Longtime User Mar 3, 2013 #4 Whenever you call File.WriteMap all the keys and values are written to the file. The file is recreated. Upvote 0
Whenever you call File.WriteMap all the keys and values are written to the file. The file is recreated.