Public Function SetBitInStringFast( _
ByVal vString As String _
, ByRef vBit As Long _
, ByRef vValue As Boolean _
) As String
Set a bit within a binary string. Examples:
Bits range from 1 (one is the least-significant-bit) to the number of bits in the value.
SetBitInStringFast(Chr$(255) + Chr$(255), 3, 0) = Chr$(251) + Chr$(255)
SetBitInStringFast(Chr$(0) + Chr$(0), 3, 1) = Chr$(4) + Chr$(0)See also:
SetBit FunctionNote: 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.
vString: String in which one of the bits is to be set to either True or False.
vBit: The number of the bit whose value within string vValue is to be changed.
Note: This function assumes that vBit represents one of the bits within the string vString and its behavior will be unpredictable if that is not true.
vValue: The value to which the specified bit will be set.
Note: Function has restrictive argument types to avoid argument fix-up overhead.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.