MPE/iX Commands Reference Manual (32650-90877)

Chapter 2 25
Command Structure Defined
Native Mode Command Structure
this string contains both a semi-colon and parentheses, you would enter SETVAR as follows:
SETVAR MYVAR ";(A)"
As another example, suppose you wanted to use the INFO= parameter of the RUN command
to pass the following string (which contains both commas and spaces) BLUE RIGHT 24,
SPLIT LEFT, 2. You would enter:
RUN PROG;INFO="BLUE RIGHT 24, SPLIT LEFT, 2"
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.