If you are talking about using a value as a 'field' to hold 'flags' e.g.:
0
1
2
4
8
16
32
64
etc.
Then it will still work. You need to think about the bits.
111 = 7 = 4 Or 2 Or 1
110 = 6 = 4 Or 2
101 = 5 = 4 Or 1
100 = 4 = 4
011 = 3 = 2 Or 1
010 = 2 = 2
001 = 1 = 1
000 = 0 = 0
So, given:
v = 7
a = 0
b = 1
c = 2
d = 4
Then:
v = a Or b Or c Or d
If (v And a) = a Then
Debug.Print "v contains a"
Else
Debug.Print "v does not contain a"
End If
If (v And b) = b Then
Debug.Print "v contains b"
Else
Debug.Print "v does not contain b"
End If
If (v And c) = c Then
Debug.Print "v contains c"
Else
Debug.Print "v does not contain c"
End If
If (v And d) = d Then
Debug.Print "v contains d"
Else
Debug.Print "v does not contain d"
End If
"Sam" <sa**************@voila.fr> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
humm actually i'm not sure it's what i want.
it returns x all the time as long as x is < 7. But 6 (for example)
cannot be contained in 7 : 2^6 = 64 > 7
Am I wrong ?