thanks for your time. I can compile the code again but it is still not working properly. Maybe the C# code was already wrong.

For ex. the flags = 4 should give me the ba[0] = false, the ba[1] = false and the ba[2] = true. Although it tell me that all first 3 are true. The same with flags = 2, should give the only the ba[1] as true but it gives me the ba[0] = true as well.

Isn't there already a working function available? I looked up but didn't find anything.