And these are working fine. But, when I try to use the same variable in another procedure that has no links with these (Launches when a button is clicked), it doesn’t work…Here are the blocks :
The button executing
The index variable is not working here, the name one is working fine strangely
Anyone ? This is really disturbing, it never happened to me
Here a picture describing better : The ones in red are the ones in which the variables are showing undefined and the ones in green where the variables work fine :
Thanks for the trick but the problem is still that the variables aren’t saving the values out of the green blocks
Also I didn’t understand what you were referring to. Are you saying that I can’t remove an item from the list by directly inserting the listviewer into the in list … block ? Because it works perfectly for me
Oh, you are correct - you can use the green blocks that way…that’s scary but true.
To the first question, the problem is that you are naming the variable “index” when the green block is already called index. These values clash with each other, meaning you can’t update the global variable “index” inside the ItemClick event.
Basically your orange variable blocks (index, name) and the green variable blocks (item, index, etc) should NEVER have the same names. Eventually we’ll change the system so this problem is more obvious.
The first thing that I would do is to have different names for the global variables that you use and the argument names for your procedures. Using the same name (e.g. 'index') is just asking for trouble. For example, in your 'check' procedure you increment the value of 'index'. Which version of 'index' do you mean? The one that is local to the 'check' procedure or the global 'index' variable that is accessible to all your blocks? Changing those names might itself fix your problem, but if not it will make it much easier to diagnose what is going wrong.
I’m saying that the way you name the arguments of the procedure is not linked to the name of your variables right ? I’m pretty stupid I didn’t get that in the first time I’m downloading the app at the moment, will keep you updated.
And another one is about the next screenshot, these blocks are supposed to replace the item at the #position but it just doesn’t change it, it adds a new one
Also, the edit variable only is set to 2 the first time the list is clicked, after that it never works.