ReadNullTerminatedString method

This is for use in place of ReadString if the string may contain embedded null characters.

This method reads the specified number of bytes from the message data buffer starting with the byte referred to by DataOffset and returns it as an ActiveX string. If the string contains an embedded null before the end then the length of the returned string is reduced to reflect only those characters before the null.

DataOffset is incremented and DataLength is decremented by the value specified regardless of whether or not the string contains embedded null characters.

The characters in the message data are assumed to be a string whose code page is specified by the MQMessage.CharacterSet property. Conversion to ActiveX representation is performed for the application.

Defined in:

MQMessage class

Syntax:
string$ = MQMessage.ReadNullTerminatedString(length&)

Parameters:

length& Long. Length of string field in bytes.