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

Get Bit In String Fast Function
Bitwise Class

Public Function GetBitInStringFast( _
      ByRef vValue As String _
    , ByRef vBit As Long _
    ) As Boolean

Get a bit from a binary string.
Bits range from 1 (one is the least-significant-bit) to the number of bits in the value.

Examples:
    GetBitInStringFast(Chr$(2) + Chr$(0), 2)  = True
    GetBitInStringFast(Chr$(2) + Chr$(0), 10) = False
    GetBitInStringFast(Chr$(0) + Chr$(2), 2)  = False
    GetBitInStringFast(Chr$(0) + Chr$(2), 10) = True
See also:
    SetBitInStringFast Function
    GetBit Function
Note: This function is different from GetBit and SetBit because this one considers the first string character to represent the LEAST-significant-byte instead of the MOST-significant-byte.
vValue: The string from which the value of one of the bits within one of its characters will be returned.
vBit: The number of the bit whose value within string vValue is to be returned.
Note: This function assumes that vBit represents one of the bits within the string vValue and its behavior will be unpredictable if that is not true.
Note: Function has restrictive argument types to avoid argument fix-up overhead.

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