Hi people, i’m having a problem and cannot solve myself in my app i make a list of saved data, they are listed in labels and tags , so if i save first time, this data go to tag “1”, if a save again, the data go to “2”, and so on…but when i delete the first tag (tag “1”) i cannot save again in this label, they save on the tag “3” and leave the tag “1” empty, how i can save again in tag “1” if i have a data already saved on tag “2”?
I hope you guys understand, is hard to explain and i don’t find similar example in YT
If you want to write data to the number that it had after deleting the Tag, then you have the wrong algorithm. Tag number is assigned based on the total number of Tags in the list. If Tags.length = 10, then after removing Tag with number 1 the next Tag will have the number 9 and will overwrite the information in it.
Sorry, I did not express myself clearly. You need to clear tags only the first time to be sure that there is no garbage in the Tiny_DB. After this delete block Clear All from project.
I’ll try to explain my whole project, maybe is more easy with the whole scenario:
I’m making a scale with 4 load cells in arduino, then by bluetooth i send the data to my app, this part is complete, but i wanna be able to save the “sessions” on a list with a length of about 20 “saved sessions”, this saved sessions opens in another screen, i tried listpick and listview, but they show all the data together on the same line, and the way i show here i can show the data on labels.
So, what’s the better way to store this saved data on labels?
PS: This blocks posted here is only a test, with only two textbox to colect the data to save.
Use a delimited string for this. You write to the first line of the session and after the end of the recording, add a unique separator character to the end of the line, for example #. After that, you add the next session to the line and at the end add a delimiter #. After writing the last session, delete the last character in line #. You will get:
session data 1 # session data 2 # … #session data 20
After that, you can break this line into a list by the symbol #. Do you understand such an algorithm?
4 cells = 1 session? If so, then your data string will be: cell1, cell2, cell3, cell4 # cell1, cell2, cell3, cell4 # cell1, cell2, cell3, cell4, etc.
Yes, four cells in 1 session, and there’s more, there’s some math to calculate % and weigth of only 2 cells, 4 cells… will be about 12 data to list in one session.
This is a list of lists (or a two-dimensional array. To get a session you have to get the session element from the external list, and to get the value of the cell in it, get a cell from the session item.
I copy this block to my project, but i don’t get how i input the data from arduino…you said to get the data in this form: ( value1,value2,value3…) directly from arduino?
I’m using the labels and textbox to display the data on the screen1, and do all the math on the app.
I tried someting today and worked!..i’m now saving on file component, i don’t have that problem and i can save with the file name and retrieve using this file name, i just want to make one more thing to be complete, if possible, i wanna to add a listview or listpicker to show the saved files, but just show the “name file”, not the data on the file, is possible?
I gave the format value1, value2, etc. as an example. It’s good that you made your format and everything works!
To display file names in the List Picker, you need to get these names from the directory in which they are stored. You can do this using the File extension: