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.

Terms include:
  • 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:
    Read syntax diagramSkip visual syntax diagram
                              .-,--------------.      
                              V                |      
    >>-+-symbol--(---------+----+------------+-+--)----------------><
       '-literal_string--(-'    '-expression-'        
    
    
Evaluation of an expression is left to right, modified by parentheses and by operator precedence in the usual algebraic manner (see section 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) may be the null string (a string of length 0). Note that REXX imposes no restriction on the maximum length of results. However, there is a 16MB limitation on the amount of a single storage request available to the language processor. See the note in REXX General Concepts for more information.


Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/expres.html