I want to manipulate localstorage but am finding it difficult. A few years ago I coded my app but think I must have used George and his team to help. Since then I have forgotten much and my brain doesn’t comprehend like it should. So a few answers here might help me start again. My app allows a user to access localstorage so whatever I learn might be useful for them also.
Here is what part of my localstorage looks like after adding a few points for a sample database.
[“1,1000,1000,pt1\n”,“2,1027.69920,1030.22837,pt2\n”,“3,1038.56960,1070.79725,pt3\n”,“4,999.93257,1081.15002,pt4\n”,“5,1034.91736,1100.54240,pt5\n”,“6,1082.14682,1126.72212,pt6\n”,"7,1028.14682,1126.7221…]
the first entry is 1,1000,1000,pt1 where 1=point number, 1000 = north coordinate, 1000 = East coordinate and pt1 = descriptor. Is this a key-value pair where point number is the “key” and the data is the “value”?
If I wanted to remove a point with its data would I use code like localstorage.removeitem(“key”)? Example code would help immensely.
How would I edit something? I tried changing a value directly in localstorage but it did not work. I could change it but the previous value returned.
If I could be pointed to a good tutorial, it would be appreciated but I am sure I will be back with more questions. Thanks to everyone in advance.
I don’t mind revealing all of the applicable code I now have if that becomes necessary,