Yes, you have the BitArray object, in the System.Collections namespace.
You can use one of its constructors to fill it automatically with the value
of an integer or a byte array (for one byte, you'd use a bite array with
only one element), and then go through it's "Items" as it if were a
collection.

Pretty good idea by MS, i have to say...

Hope this helps.
Daniel

> -----Mensaje original-----
> De: Anthony [mailto:[EMAIL PROTECTED]
> Enviado el: Saturday, December 04, 2004 14:52
> Para: [EMAIL PROTECTED]
> Asunto: [vbhelp] Finding if a bit is set
>
>
>
> I need to find out if a particular bit is "set". In the days pre-.Net I
> would do something like this.
>
> iTemp = Value
> For i = 7 to 0 Step -1
>     If iTemp > 2^i Then BitSet(i) = True
>     iTemp = iTemp - (2^i)
> End If
> Next i
>
> Does .Net introduce a better way?
>
> TIA,
> Anthony
>
>
>
>
> '// =======================================================
>     Rules : http://ReliableAnswers.com/List/Rules.asp
>     Home  : http://groups.yahoo.com/group/vbHelp/
>     =======================================================
>     Post  : [EMAIL PROTECTED]
>     Join  : [EMAIL PROTECTED]
>     Leave : [EMAIL PROTECTED]
> '// =======================================================
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to