advice on array

Hello. I'm thinking how to do something, however, I still cannot resolve it. That "something" is: I have a boolean array of 8 positions, which holds the data of 8 switches. I need to execute certain function when only one of the switches is HIGH and the rest LOW. How could I do it? Any hint? thanks

Use a for loop and examin each element in turn. For each one you find high increment a counter. Then only do what you have to if this count is exactly one.

Grumpy_Mike: Use a for loop and examin each element in turn. For each one you find high increment a counter. Then only do what you have to if this count is exactly one.

Will try it. experts always make us see the light :) thanks

edit: it worked, thanks again