Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00) (30216-90269)

192 Chapter 10
Technical Articles
CI Enhancements
New Evaluator Functions
ANYPARM
ANYPARM() returns any combination of characters as a string. String
function.
Syntax
ANYPARM(anything)
This new function accepts all characters, including, commas, quotes,
right parentheses, etc. and treats them as a single string value. This is
handy when used in conjunction with the ANYPARM parameter type. The
one exception is that the "!" character, which introduces a CI variable.
The ANYPARM() function has two important restrictions:
It must be the last (right-most) or only function on a command line
It may not be nested inside other function arguments. For example,
lft(ANYPARM(…),1) is not supported, nor is word(ANYPARM(…)).
These constraints are necessary since ANYPARM() accepts all
characters as its argument, including right parentheses.
Examples
Assume the script is named “doit”:
ANYPARM p1
option list
setvar _infostr ANYPARM (!p1)
run prog; info=”![repl(_infostr,‘”’,‘””’)]”
...
:doit abd”def’fhi)klm,p,q)r
setvar _infostr anyparm(abc”def’fhi)klm,p,q)r)
run prog; info=”abc””def’fhi)klm,p,q)r”
NOTE In the last example, if one of the characters is a "!" then the CI will
attempt to reference a variable that follows the "!". For example, if the
"f" is replaced by a "!" then the CI will try to reference a variable named
HI. If this variable is not found a CI warning is reported.
BASENAME
BASENAME()—returns the filename component of a POSIX or MPE
filename. String function.
Syntax
BASENAME(str[,suffix])
This new function returns the base component (file part only) for the
passed filename. str can be any filename in MPE or POSIX syntax. suffix
is an optional string, that if supplied and the filename base ends in suffix