Public Function BinaryStringFmString( _ ByVal vValue As Variant _ , ByVal vFmLSBFirst As Variant _ , Optional ByVal vToLSBFirst As Variant _ ) As Variant
Assuming Dim strValue As String strValue = Chr$(3) + Chr$(12) for example BinaryStringFmString(strValue, False, False) = "0000001100001100" ' #1 BinaryStringFmString(strValue, True, False) = "0000110000000011" ' #2 BinaryStringFmString(strValue, False, True) = "0011000011000000" ' #3 BinaryStringFmString(strValue, True, True) = "1100000000110000" ' #4Example #1 converts from most-significant-byte-first to most-significant-bit-first. It is usually used for converting String values, and it is also used for converting numbers from most-significant-byte-first architectures.
BinaryStringToString Function BinaryStringFmVariant FunctionvValue: String whose characters' bits are to each be represented by one character within the result string. Function returns Null if vValue is Null or cannot be fixed up to a String.
vFmLSBFirst: True if the bytes in String vValue are organized with the least-significant-byte first, and False if the bytes in String vValue are organized with the most-significant-byte first. vFmLSBFirst defaults to False if it is Null or cannot be fixed up to a number.
vToLSBFirst: True if the result string should represent the bits with the least-significant-bit first, and False if it should represent the bits with the most-significant-bit first. vToLSBFirst defaults to False if it is missing or Null or cannot be fixed up to a number.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.