hello i am currently working on a code and i have a problem with my list
i have created a list with tiny dB that can save numbers and sum them and show them on labels but when i try save the progress it saves and when i want to show them it just pop up 5050 idk why from hamada to duolingo.aia (5.0 MB)
its located in fitness screen its not in English but if u need anything to translate just ask me and button 7 is the button that show the progress
button 1 is for start
button 2 is for stope
button 3 is for rest
thanks
I guess the code is not working neither for him....anyway, do you understand what are you doing in that Initialize block? what do you want to achieve and how those blocks work?
Initialize block is executed when the screen starts.
First thing you are doing is to read from tinyDB the value stored under the tag "calories" and storing the value in the global variable "progress_list":
and here comes the strange thing... you are creating a new list ("global list"), with the number from 1 to 100 and storing it under the tag "calories" (overwriting the information you had stored in tinyDB):
So, what you have at this point in tinyDB, in the "calories" tag is a list of numbers from 1 to 100. Do you need this part of the code for anything? Has it sense for you?
Well,, but that will not happen in Initialize block, because in that block, you are "starting" the screen and, anyway, there you are storing the numbers from 1 to 100....try to remove that last part of the code with no sense and, when button4.Click, you are adding the label4.text value to the list...then try to store there the list in tinyDB.