
Chapter 2 33
Command Definitions A-B
Native Mode Command Structure
String Processing
MPE/iX string processing finds the first double or single quote and pairs it with the last
quote of the same type to form a string. In other words, single quotes pair only with other
single quotes and double quotes only with other double quotes. For this reason you can use
single quotes within double quotes, and double quotes within single quotes. For example,
all three of the following INFO strings are correct:
...;INFO="THIS IS THE 'WRITE' WAY"
...;INFO='THIS IS THE "WRITE" WAY TOO'
...;INFO="YOU SIMPLY CAN'T GO WRONG"
In all of the above cases, the quotes around the word WRITE and in the word CAN'T are
contained within the string and are treated just like any other character.
Quotes within Strings
A technique called quote folding enables you to embed single or double quotes in quoted
strings. For example, the following INFO= string would pass the string shown below it:
... ;INFO="JUST SAY ""GATO""."
JUST SAY "GATO".
Quote folding works as follows: When the NM parser reads a quote (other than the very first
quote in an entire line), it checks the character to the immediate right of the quote. If it is
a quote of the same kind (single or double) it is disregarded and the previous quote is
treated like any other non-quote character. For example, after being parsed, the following
quoted string becomes the string listed below it:
...;"PASS ""A"" TO ""X"" AND ""B"" TO ""Y"""
PASS "A" TO "X" AND "B" TO "Y"
Here is another example:
"HERE ARE FOUR QUOTES "" "" "" """
HERE ARE FOUR QUOTES " " " "
To delete spaces between the four quotes, you would enter the string like this:
"HERE ARE FOUR QUOTES """""""""
After being parsed, the string would look like this:
HERE ARE FOUR QUOTES """"
The NM parser processes quoted strings in the same way regardless of the command or
parameter with which they are used.
For most CM commands, the CM parser processes quoted strings in the same way as the
NM parser. However, the CM parser limits the length of quoted strings to 255 characters.
Exceptions
There are four exceptions to the syntax governing MPE/iX commands:
• User command parameter lists (which may affect string quoting rules).