<-- Previous || Up || Next -->

Get Bit Function
Bitwise Class

Public Function GetBit( _
      ByVal vValue As Variant _
    , ByVal vBit As Variant _
    ) As Variant

Get a bit from any type of value.
Return True if the specified bit is on, or False if it is off.
Bits range from 1 (one is the least-significant-bit) to the number of bits in the value.

Examples:
    GetBit(2, 2) = True
    GetBit(2, 1) = False
    GetBit(Chr$(2) + Chr$(0), 10) = True
    GetBit(Chr$(2) + Chr$(0), 2) = False
See also:
    SetBit Function
    FlipBit Function
    GetBitInStringFast Function
vValue: Value from which one of the bits of its in-memory representation is to be returned. Function returns Null if vValue is Null.

vBit: The number of the bit whose value within variable vValue is to be returned. Function returns Null if vBit is Null of cannot be fixed up to a number.

Function returns Null if vBit is <= 0 (less than or equal to zero).

Function returns Null if vBit is greater than the number of bits within the value vValue.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.