04-18-2010 03:46 AM
We have a number of booleans. We want that when any one becomes TRUE, we would change a parameter in a different button.
If it was only one boolean, we would have no problem, but we have 36 such booleans. Does anyone have a way of programming this so that we don't have 36 nested IF cases? the booleans can become TRUE together.
To check if any boolean is true, we poll all of them in a while loop (they are hardware-connected and unfortunately the hardware is not built for interrupts, so polling is the only way).
Can anyone help?
Solved! Go to Solution.
04-18-2010 04:06 AM
where do you get the boolean values from? Is it necessary to poll them? You can use refnums from your controls. Build an array of all these refnums. With index array you can then set a specified value.
04-18-2010 04:44 AM
It is unfortunately necessary to poll them.
The problem is not setting the values, it is knowing to which control to set the value. We get a number of booleans, and we need to check which are true and set our controls accordingly. for example, booleans 1,6 and 20 are true, so we need to change controls 101, 106 and 120. Other then checking each of the 36 booleans in 36 parallel IF loops, are there any suggestions for how to determine which controls we need to change?