I have a set of 25 buttons. I have 2 lists, one with the buttons and the other with the state they can be in. Buttons can be green and have a value of 1 in the status list, and others are red and have a value of 0 in the status list. These colors are assigned randomly.
If I do a DoIt on the OnOff procedure call everything is fine. But if I use the "btnInicio" button I get the following message.
I tried changing the values of 0 and 1 to the numbers 1 and 2 (to avoid the 0) or to the letters "F" and "V". Also try swapping for values of true and false and I always get the same error. I also tried to unify the lists and got other types of errors so I decided to go back to the original scheme.
My suspicion is that this problem occurs at the time of doing the replacement of values in the stateBtn list, but I don't know how to solve it.
Here are the blocks