Lists and variables

They are erasing the old values and replacing it with new value. Imagine you have a machine and you don't want to lose the exact calibrage, you store it in test 1, you make another experience you store the values in test 2... Til test 10, now all of them are filled, you want to store new values but the test are full, you erase an old values to replace it with new one.

So "erasing" means

  1. replacing one of the sublists by another list

and 2) displaying the updated data in the user interface

Did you consider to display the data in a table? This would be much simpler with only a few blocks

Taifun

Okey I will try this solution and let you know. Thank you

The replace list with another list do you mean like this? y list where I have my values is the list records, it's an empty list that I filled it with my values from Settings tag, the erase button that should take this values, and put them in a new list, I didn't know how to code it. If you could help me please.

records is your list of lists
But where is the list of new data?

You have to seperate 2 things: 1) the data itself and 2) displaying the data

The first step is updating the data, which is your global varriable records

The second step is displaying the data, remember I suggested to display it as table...

Taifun

records is an empty list. My list of lists is DATA it's in the other screen. Yes now I want a to everytime I click erase I replace either empty/ filled labels with the new values that Are in the list records that is always showing when I initialize the screen. Because I got them from the tag Setting that contains the list DATA that contains list of 10 sublists.
I did my own method that I showed previously but it(s very very long. Just have a look at my button Erase that I coded ( not the last image I showed, before that). If I continue that way for every button Erase, how can I always display my data even when I leave the screen. To store every Label alone under a tag and call gettag when Screen iniliazes and set the label to get the variable stored under it. It's very hard and long.

I asked my professor if he wanted it as table he said no, He said to display it like I showed before.

If you had to display 10 tests and a temporary test where you store your lasts values. And every time you click replace you get this temporary test. How would you do it?

previously you told us, you like to replace a complete sublist by a new sublist

yes, we are talking about that method all the time to simplify it by just one replace list item bock, but unfortunately you just continue using your method, so there is not much I can do now

you are complicating things
also you are using 2 TinyDB namespaces... why that? you only have one list of lists of the complete data... and a new list with 10 items...

I would have a list of lists, which has 10 sublists and each sublist has 10 items
and I would have a new list, which has 10 items

I would use only one replace list item block like this

Tafiun

it looks like you have to go back one step and learn how to work with lists
probably you are confused how I'm using the list from csv block?
this
Unbenannt
is the same like this
Unbenannt2
only the first example is a little bit shorter, isn't it?

from my example screenshot listMain is your list from post 3 Lists and variables - #3 by lyna_mansouri

and listNew is a simple list which has 10 items

remember, what you said earlier

here is again the list tutorial

Taifun

I did my best with this project. I think I will stop here and abandon it, maybe I didn't explain myself well. I know how to work with lists, the lists were never my probleme, The code with a tag and different tags to each test were. I did exactly what you told me to do the first time by using the block replace, and asked for more help in order to set every label with the correct order. then you gave me another idea and I followed it blindly in order for you not to say that i am stubborn and I continue using my idea. However I genuinely appreciate your help. Maybe I can figure something on my own and If i hesitate with something I will open another topic. Thank you.

you did very good and you did not give up too soon... :+1:
I will repeat the most important points

and remember the example blocks from post #49 Lists and variables - #49 by Taifun
sometimes it is a good idea to start fresh...
remember to use procedures and follow the DRY principle... Don't repeat yourself

Taifun

1 Like

Maybe the best is to have 2 layout instead of 2 screens with any of them hidden while the other is visible. That solve a lot of passing parameters problems...

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.