Function Co Decs Class

RunLengthDecodePrintable

Decode a string which was encoded with RunLengthEncodePrintable . This function is mainly used to decompress Visual Basic Global/Public Constant strings which are to contain "non-printable" characters (or those characters which Microsoft recommends should not appear within Visual Basic nor VBA Modules).

Signature (Visual Basic / VBA)

Public Function RunLengthDecodePrintable( _
    ByVal vValue As Variant _
    ) As Variant

Code Examples

    RunLengthDecodePrintable("One}-}*})Two") = "One" + vbCrLf + Chr$(9) + "Two"
    RunLengthDecodePrintable("This is a test.") = "This is a test."
    0..31:    Chr$(125) + Chr$(N + 32)
    32..123:  Chr$(N)
    124..183: Chr$(125) + Chr$(N - 60)
    183..255: Chr$(126) + Chr$(N - 151)

Parameters

Parameter Description
vValue The string created by the RunLengthEncodePrintable function which is to be decoded. Function returns Null if vValue is Null or cannot be fixed up to a String.

Notes & Version History

Algorithm Characters with the ASCII value on the left were replaced by the string on the right.