> then at situation B, I need to switch on Switch5, etc. Can I write
> just one command, with the switch number as the input, so that it can
> switch on different boolean control (Switch#) at different time? (i.e.
> treating the variables Switch1 to Switch10 as an array of variables
> called Switch#).
Assuming this is for the UI of your application, I'd suggest using an
array of Control references to the Switches. Popup on each of the
switches and create a reference node. Wire those to create an array of
references. Now wherever in your program you want to affect a
particular switch, index the array and operate that reference with a
property node. If you do this commonly, make a subVI that takes the
reference array and the index and does the work the
re.
It is also possible to make the array of references without making the
ten reference nodes using the Controls[] property of the panel, but for
ten switches, this is about the same.
Greg McKaskle