Kilowatt Software's
Classic Rexx Tutorial
Language Level 4.00 (TRL-2)

Continuation

Occasionally the readability of a Rexx instruction is improved when the instruction is continued on multiple source lines. There are two ways to continue Rexx instructions.

  Ending the line with a comma

  Ending the line with an incomplete remark

Commas at the end of lines

Rexx instructions are continued when the last significant character of the source line is a comma. When the only characters that follow the comma are spaces or comments, then the source line is continued.

Here is an example of a lengthy parse instruction, that spans multiple source lines. In this example, the input request is a string value, with fields separated by tab characters. Each source line that follows the parse instruction obtains one tab-delimited field. Each of these lines, except the last line, ends with a comma.

Incomplete remarks at the end of source lines

Rexx instructions are also continued when the line ends in the middle of a remark.

Here is an example of an instruction that is continued with a remark.

Value concatenation across multiple source lines

When a source line contains multiple terms that are separated by a continuation request, the values are typically concatenated with an intervening space.

Often, you will want to concatenate the values without an intervening space. This is accomplished by adding an abuttal operator, at the front of the lines which follow the first.

Spanning a function call across multiple lines

Commas are used as argument separators in function calls. When a function call spans multiple source lines, usually you will split the line at a specific argument position. In this case, the line must conclude with two commas. The first is an argument separator, and the second is a line continuation request.

Spanning argument parsing across multiple lines

Commas are also used in the templates of ARG and PARSE ARG instructions. In these instructions, the comma indicates that processing of the current procedure argument string is complete, and to proceed with the next argument string. It is tempting to split the template at the commas. However, you must conclude the source line with two commas in this case. The first comma is a template character, the second is a line continuation request. Here is an example of the splitting of a template that processes arguments.


Kilowatt Software's -- Classic Rexx Tutorial -- Back to top
Click here if you have any comments or questions regarding this tutorial

Last updated on: 8 Aug 2002