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

Comments

Portions of Rexx programs can be hidden from interpretation by encapsulating these as commentary text. A comment is started by a slash and asterisk, /*, without an intervening space. A comment is concluded by an asterisk and slash, */, again without an intervening space. Any characters are allowed within the comment sequence, including slashes and asterisks. However, Rexx comments can also be nested. Comments also act as source separators, which may have surprising effects.

A common type of comment is at the end of a line, for example:

Comments can also be present within a line, for example:

Another common type of comment is a sequence of lines that describe subsequent logic, for example:

It is recommended that you begin your Rexx programs with a comment ! In some environments, a leading comment is used to ascertain whether a source file is a potential program.

Comments are also used in Rexx programs to deactivate a portion of program logic, for example:

Nested comments

Rexx comments can be nested. When a /* character sequence is found within a Rexx comment the nesting depth is incremented. Each subsequent */ character sequence decrements the nesting depth. At a depth of two, the comment is not concluded until two */ character sequences occur. The nesting depth can exceed two levels. The following is an example of a nested comment.

Comments act as source separators

When two terms are separated by a comment, the values of the terms are concatenated without an intervening space.

If there are spaces around the comment, then the values of the terms are concatenated with an intervening space.


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