Expressions
Expressions consist of one or more terms (literal strings, symbols, function calls, or subexpressions) interspersed with zero or more operators that denote operations to be carried out on terms. A subexpression is a term in an expression bracketed within a left and a right parenthesis.
- Literal Strings (delimited by quotation marks), which are constants
- Symbols (no quotation marks), which are translated to uppercase. A symbol that does not begin with a digit or a period may be the name of a variable; in this case the value of that variable is used. Otherwise a symbol is treated as a constant string. A symbol can also be compound.
- Function calls (see Functions), which are of the form:
Evaluation of an expression is left to right, modified by parentheses and by operator precedence in the usual algebraic manner (see Parentheses and operator precedence). Expressions are wholly evaluated, unless an error occurs during evaluation.
All data is in the form of “typeless” character strings (typeless because
it is not—as in some other languages—of a particular declared type,
such as Binary, Hexadecimal, Array, and so forth). Consequently, the
result of evaluating any expression is itself a character string.
Terms and results (except arithmetic and logical expressions) can
be the null string (a string of length 0).
Note that REXX imposes no restriction on the maximum length of results.
However, there is usually some practical limitation dependent upon
the amount of storage available to the language processor.