A SERVICE OF

logo

564 Chapter 7
Command Definitions S-SO
SETVAR
SETVAR
Assigns values to MPE/iX variables. (Native Mode)
Syntax
SETVAR varname{ <space> , ; } 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
7-1 may be used in expression.
Table 7-1 Logical Operators - The SETVAR Command
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).
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