|
|
MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 2 Command Definitions A-BNative Mode Command Structure |
|
Many commands in this chapter have the designation Native Mode at the end of their definition. This means that the command is parsed by the Native Mode Command Parser. If Native Mode is not specified, the command is parsed by the Compatibility Mode Command Parser. (A command parser separates command parameters.) There is no relationship between the parser a command uses and the function(s) the command performs. Also, just because a command is parsed by the Compatibility Mode parser does not mean it functions in the same way it did in the Classic HP3000 environment. All new commands for MPE/iX use the NM parser. Some commands used on MPE V/E which have been changed for MPE/iX use the NM parser and some do not. MPE V/E commands which have not been changed for MPE/iX generally use the CM parser. The important thing to remember is that the Native Mode parser accepts several different formats for commands that you enter at the colon prompt (:). You may enter these NM-parsed commands in one of the following ways:
Another difference between the NM parser and the CM parser is that the CM parser restricts a single comand parameter value to be <=255 characters. On the NM side, the value is limited by the size of the CI's command buffer. You may enter an NM-parsed command as shown in the syntax diagram for each command, for example:
You may also enter an NM-parsed command by omitting the keyword parameter name and only entering the values as positional parameters, for example:
If you omit the keyword specifications and enter the values as positional parameters, the values must be treated as such, and all rules for positional parameters must be followed. For example, if you only specify A and C, you must use the positional place holder (,) as shown in the following example:
Another option is to enter NM-parsed commands by using a combination of positional and keyword specifications, for example:
There is one important rule to remember when you combine positional and keyword parameters: once you specify a keyword parameter, you may no use positional parameters. For example, entering the following command would produce an error:
An exception to the rule is that you may specify positional parameters that are subparameters of a keyword parameter. For example, in the BUILD command shown below, REC is a keyword but the next four parameters (which define records as being 80 bytes long, blocked at 1 and in Fixed ASCII format) are positional. This syntax is acceptable because they are subparameters of the key word REC.
The following example shows the correct way to combine positional and keyword parameters where the keyword has no subparameters:
You may enter numbers as parameters to NM-parsed commands as follows:
For example, suppose you wanted to suspend spooling on LDEV 6, your system printer. You could enter :
Or, because decimal is the default you could omit the # sign and enter:
Or, omitting the leading zeroes you could enter:
When entering numbers as command parameters, it is advisable to omit leading zeros for some commands parsed by the compatibility mode (CM) parser. The NM parser optionally accepts any string input in single or double quotes. For example, because the file name parameter of the PRINT command is a string parameter, you could enter it as follows:
or
or
Quotes are required if the value of any string parameter contains any of the following delimiters:
For example, suppose you want to set a variable called MYVAR to a value of ;(A). Because this string contains both a semi-colon and parentheses, you would enter SETVAR as follows:
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:
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:
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. 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:
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:
Here is another example:
To delete spaces between the four quotes, you would enter the string like this:
After being parsed, the string would look like this:
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. There are four exceptions to the syntax governing MPE/iX commands:
These three exceptions allow the use of only specific delimiters when specifying parameters, as defined below. Also the ECHO command accepts all delimiters and treats them as part of the value to be echoed User defined commands may be structured to accept the KEYWORD=parm format, and you may mix keyword and positional parameters. User command parameter lists allow you to use the following to delimit parameters:
For example, if the user defined command UDCA is defined as UDCA parm1,parm2,parm3 you could invoke it as follows:
or
If the value of any parameter contains any of the above delimiters you must use quotes to delimit the parameter string. For example, if I;J;K is a single string parameter value you must delimit it with quotes (because it contains semi-colons) as follows:
The = sign is used only to delimit a parameter name from a parameter value. If the value of a parameter contains an = sign, then you must delimit the value with quotes. For example:
Similarly, if a string value contains a quote, you must delimit it by a quote. As an example, suppose you have a UDC which runs a program with the INFO string. The RUN command within the UDC might look something like this:
If the value of the parameter were something like this: THE "END" IS NEAR, you would invoke the UDC like this:
Or, you could enter this:
For more information on the use of quotes, refer to the section "Using Quotes and Strings" earlier in this chapter. The SETVAR command allows you to use either spaces, semicolons, or commas to delimit parameters, as follows:
The rules for using quotes within strings containing delimiters or quotes, previously discussed, apply to the SETVAR command. For example, suppose you want to set a variable called BIGVAR to a value of X,"Y";Z. This expression contains two delimiters (comma and semicolon) as well as quotes. The correct SETVAR command would be:
You could also delimit the expression from the variable name using either a comma or semicolon as follows:
For more information on the use of quotes, refer to the section "Using Quotes and Strings" earlier in this chapter. The XEQ command allows you to use only spaces to delimit parameters, as follows:
|
|