Diego,
In addition to the other comments:
| how can i get the coorect result for values greater than 256
Define "correct result", as the example you show is "correct" (see Carlos'
example for why).
Try the following:
For value As Integer = 246 To 266
Debug.WriteLine(value And 1, Convert.ToString(value, 2) & " and
1")
Debug.WriteLine(value And 2, Convert.ToString(value, 2) & " and
2")
Next
Remember the And operator does bitwise anding with ordinal (integer) values,
not logical anding. If you want logical Anding you need to convert the
operarands to Boolean values first...
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
| hi all,
|
| 255 and 1 = 1
| 255 and 2 = 2
|
| 256 and 1 = 0
|
| how can i get the coorect result for values greater than 256
|
| i hope you understand what i'm getting at.
|
| thanks in advance
|
| diego
|