I need some help with variable.
I would like to use the value of a variable as a list’s name to be able to modify it.
For example : i have two players and i need to change the amount of colored balls owned by the players. Each player has a dedicated button. Same for each ball. And when i click on one of these it changes by 1 the amount of ball of the selected player.
- For each player i create a list with item 1 = name, item 2 = number of red ball, item 3 = number of green ball, etc.
- First, i select the player.
- Then i click on a ball’s button to change the number by 1.
Right now, i can do this by using “if…do” control. But there are too many as the number of player increase and slow down the app.
My wish is to set a variable in the name of player’s list when i select a player.
Then, when i click to modify the amount of ball, call that variable as the list’s name.
Below the blocks of what i have in mind. As it is, it does’nt work.
Maybe i am misusing the variables. I will appreciate any help.
Thank your for your time.