Properties

IntValue

LastMethodSuccess

LastMethodSuccess As Long

Indicate whether the last method call succeeded or failed. A value of 1 indicates success, a value of 0 indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

AppendBd

Appends the contents of binData. The charset specifies the character encoding of the bytes contained in binData. The charset can be any of the supported encodings listed at Chilkat Supported Character Encodings. To append the entire contents of binData, set offset and numBytes equal to zero. To append a range of binData, set the offset and numBytes to specify the range.

ContainsWord

Returns 1 if the word is contained within this object, but only if it is a whole word. This method is limited to finding whole words in strings that only contains characters in the Latin1 charset (i.e. iso-8859-1 or Windows-1252). A whole word can only contain alphanumeric chars where the alpha chars are restricted to those of the Latin1 alpha chars. (The underscore character is also considered part of a word.)

For case sensitive matching, set caseSensitive equal to 1. For case-insensitive, set caseSensitive equal to 0.

Decode

Decodes and replaces the contents with the decoded string. The encoding can be set to any of the following strings: "base64", "hex", "quoted-printable" (or "qp"), "url", "base32", "Q", "B", "url_rc1738", "url_rfc2396", "url_rfc3986", "url_oauth", "uu", "modBase64", or "html" (for HTML entity encoding). The full up-to-date list of supported binary encodings is available at the link entitled "Supported Binary Encodings" below.

Note: This method can only be called if the encoded content decodes to a string. The charset indicates the charset to be used in intepreting the decoded bytes. For example, the charset can be "utf-8", "utf-16", "iso-8859-1", "shift_JIS", etc.

GetDecoded

Decodes and returns the decoded bytes. The encoding can be set to any of the following strings: "base64", "hex", "quoted-printable" (or "qp"), "url", "base32", "Q", "B", "url_rc1738", "url_rfc2396", "url_rfc3986", "url_oauth", "uu", "modBase64", or "html" (for HTML entity encoding). The full up-to-date list of supported binary encodings is available at the link entitled "Supported Binary Encodings" below.

Returns a zero-length byte array (as a Variant) on failure.An empty array will have a UBound of -1 meaning 0 elements.

GetEncoded

Returns the string contents encoded in an encoding such as base64, hex, quoted-printable, or URL-encoding. The encoding can be set to any of the following strings: "base64", "hex", "quoted-printable" (or "qp"), "url", "base32", "Q", "B", "url_rc1738", "url_rfc2396", "url_rfc3986", "url_oauth", "uu", "modBase64", or "html" (for HTML entity encoding). The full up-to-date list of supported binary encodings is available at the link entitled "Supported Binary Encodings" below.

Note: The Encode method modifies the content of this object. The GetEncoded method leaves this object's content unmodified.

GetNth

Returns the Nth substring in string that is a list delimted by delimiterChar. The first substring is at index 0. If exceptDoubleQuoted is 1, then the delimiter char found between double quotes is not treated as a delimiter. If exceptEscaped is 1, then an escaped (with a backslash) delimiter char is not treated as a delimiter.

LastNLines

Returns the last N lines of the text. If fewer than numLines lines exists, then all of the text is returned. If bCrlf is 1, then the line endings of the returned string are converted to CRLF, otherwise the line endings are converted to LF-only.

ReplaceWord

Replaces all word occurrences of a specified string in this instance with another specified string. Returns the number of replacements made.

Important: This method is limited to replacing whole words in strings that only contains characters in the Latin1 charset (i.e. iso-8859-1 or Windows-1252). A whole word can only contain alphanumeric chars where the alpha chars are restricted to those of the Latin1 alpha chars. (The underscore character is also considered part of a word.)

SetNth

Sets the Nth substring in string in a list delimted by delimiterChar. The first substring is at index 0. If exceptDoubleQuoted is 1, then the delimiter char found between double quotes is not treated as a delimiter. If exceptEscaped is 1, then an escaped (with a backslash) delimiter char is not treated as a delimiter.

WriteFileIfModified

WriteFileIfModified(path As String, charset As String, ByVal emitBom As Long) As Long

Introduced in version 9.5.0.73

Writes the contents to a file, but only if it is a new file or if the contents are different than the existing file. If emitBom is 1, then the BOM (also known as a preamble), is emitted for charsets that define a BOM (such as utf-8, utf-16, utf-32, etc.)