I'm having trouble getting this to work. I thought I must have been doing this wrong, but after looking at the above answer I'm doing it exactly the same.
I;m actually setting up a bitarray that is all true, then eliminating each bit (setting to false) as I verify that it can't be true. The end result is either none are true, or only one is.
I have debugged out the values in the bitarray and that part of my function is working, there is one true and the rest false.
However when I use CopyTo to convert it into an int (using the int[1] method above) the int value is -524287
I don't know how it get's a negative, but interestingly 524287 would be the number I got from my bitarray if they were all set to true.
Any ideas on this one?
Cheers,
Adsy