NameValueString (MQCHARn)

This is a variable-length character string containing name-value pairs in the form:
name1 value1 name2 value2 name3 value3 ...
Each name or value must be separated from the adjacent name or value by one or more blank characters; these blanks are not significant. A name or value can contain significant blanks by prefixing and suffixing the name or value with double quotation marks; all characters between the open double quotation mark and the matching closing double quotation mark are treated as significant. In the following example, the name is FAMOUS_WORDS, and the value is Hello World:
FAMOUS_WORDS "Hello World"
A name or value can contain any characters other than the null character (which acts as a delimiter for NameValueString). However, to assist interoperability an application can restrict names to the following characters:

  • First character: upper or lowercase alphabetic (A through Z, or a through z), or underscore.
  • Subsequent characters: upper or lowercase alphabetic, decimal digit (0 through 9), underscore, hyphen, or dot.

If a name or value contains one or more double quotation marks, the name or value must be enclosed in double quotation marks, and each double quotation mark within the string must be doubled:

Famous_Words "The program displayed ""Hello World"""
Names and values are case sensitive, that is, lowercase letters are not considered to be the same as uppercase letters. For example, FAMOUS_WORDS and Famous_Words are two different names.

The length in bytes of NameValueString is equal to StrucLength minus MQRFH_STRUC_LENGTH_FIXED. To avoid problems converting the user data in some environments, make this length a multiple of four. Pad NameValueString with blanks to this length, or terminate it earlier by placing a null character following the last significant character in the string. The null character and the bytes following it, up to the specified length of NameValueString, are ignored.

Note: Because the length of this field is not fixed, the field is omitted from the declarations of the structure that are provided for the supported programming languages. Parent topic: Fields for MQRFH