[SOLVED] Hello, I have a problem with a set of blocks which is not working correctly although in my opinion there should not be a problem

Hello !

My problem is that:
When I click on a button, a piece of block executes. This piece of block is supposed to put +1 to a variable but it doesn’t seem to work. In the rest of this block, I put a “navigate to” which sends to a blank page and which is automatically returned to the previous page 1 second later. This part allows me to rerun the “when page open” code to be able to change something in the display so that it appears differently depending on the result of the variable. For a test, I put a “label” in the center of this page with the content of the variable on it to which we put +1 and which normally changes each time we arrive at the page. But following this, the content of the variable remains on one (I know this thanks to the test) and does not change to two. So the problem is either that the variable does not change or that when we arrive on the page, the thing to change does not change, but normally it should change because when I arrive from another page for the first time, it works .

Thank you !

I’m sorry, I just understood my problem, problem solved. The problem was that I did an if which checked if the variable was = at 1 and if so put +1 to the variable, but then I added an if which checked if the variable was = at 2 and so it became the case, this if added +1 and so on while I just wanted it to gain 1 each time I pressed the button, in fact it gained 6 (my maximum) then it came back to 1 so nothing changed for me in the end.

1 Like

Thank you for sharing the solution!