SETVAR [ MPE/iX Commands Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Commands Reference Manual Volume I
SETVAR
Assigns values to MPE/iX variables. (Native Mode)
Syntax
{<space>}
SETVAR varname{, } expression
{; }
Parameters
varname The variable that is to be set to a value.
expression The expression that is evaluated and assigned to
varname.
Operation Notes
This command assigns values to MPE/iX variables. Variable names may be
any combination of letters and numbers plus the underbar character, up to
a total of 255 characters. Variables must start with a letter or the
underbar character.
The expression parameter may be an MPE/iX expression, a Boolean, integer,
or string value, or the name of another variable. If expression consists
of elements and operators MPE/iX accepts ('abc' + 'cd' or 2*5+1), SETVAR
will evaluate it. The operators defined in table 2-26 may be used in
expression.
Table 2-27. Logical Operators - The SETVAR Command
--------------------------------------------------------------------------------------------
| | |
| Logical operators: | AND, OR, XOR, NOT |
| | |
- -
| | |
| Boolean functions and values: | BOUND, TRUE, FALSE, ALPHA, ALPHANUM, NUMERIC, ODD |
| | |
- -
| | |
| Comparison operators: | =, <>, <, >, <=, >= |
| | |
- -
| | |
| Bit manipulation operators: | LSL, LSR, CSR, CSL, BAND, BOR, BXOR, BNOT |
| | |
- -
| | |
| Arithmetic operators: | MOD, ABS, * , / , + , -, ^ (exponentiation) |
| | |
- -
| | |
| Functions returning strings: | CHR, DWNS, UPS, HEX, OCTAL, INPUT, LFT, RHT, RPT, |
| | LTRIM, RTRIM, STR |
| | |
- -
| | |
| Functions returning integers: | ABS, LEN, MAX, MIN, ORD, POS, TYPEOF |
| | |
- -
| | |
| Other functions: | FINFO, SETVAR |
| | |
--------------------------------------------------------------------------------------------
The allowed operands are any variable, integer constant (hexadecimal ($),
octal (%), or decimal) quoted string constant, the Boolean constants TRUE
and FALSE, or the JCW mnemonics (SYSTEM, FATAL, for example, as defined
in the SETJCW command).
Note that all variables are global, so the CI variable name should not be
the same as the JCW name that is being used or the operation of the code
that uses that JCW will be affected.
Compound logical expressions can be formed using the AND, NOT, XOR, and
OR logical operators, and nested within parentheses.
The Boolean value of the keyword TRUE or FALSE is overridden if there is
a variable of the same name. For example, to store the string value
'ABC' in X, enter:
SETVAR TRUE 'ABC'
SETVAR X TRUE
The SETVAR command may be used to set the command interpreter's search
path (HPPATH), the command interpreter's prompt (HPPROMPT), and all other
variables. You use SHOWVAR to see all the variables that were created by
the user. Issuing SHOWVAR @ causes the display of every predefined and
user-defined variable.
Use
This command may be issued from a session, job, program, or in BREAK.
Pressing Break terminates an INPUT ( ) function.
Example
To change the command interpreter prompt to your username.accountname,
enter:
SETVAR HPPROMPT "!HPUSER.!HPACCOUNT:" or
SETVAR HPPROMPT HPUSER+"."+HPACCOUNT+":"
The result is the same regardless of which form of the command you use.
Related Information
Commands DELETEVAR, INPUT, SETJCW, SHOWJCW, SHOWVAR
Manuals Appendix A, "Predefined Variables in MPE/iX"
Appendix B, "Expression Evaluator Functions"
MPE/iX 5.0 Documentation