A script may contain comments. A comment is simply a /* followed by a space, and then */. You can optionally put any desired text inbetween the /* and */.

A comment can span any number of lines, and have any amount of text inside of it. REXX simply ignores everything inbetween the /* and */.

Here's an example of a comment:

/* REXX ignores all of this text. */

You may nest comments (ie, put a comment inside of another comment). But you need to make certain that for every /* there is a matching */ afterward.

Here's an example of a comment inside of another comment:

/* Here's some text...
/* Here's a comment inside of another comment. */
... that the interpreter ignores. */

You can put as many comments as you like in your script, and put them anywhere you'd like, but be careful of doing something like trying to put a comment inbetween some variable's name. (We'll get to variables soon). For example, assume that you have the compound variable MyVar.MyTail and you try to put a comment as so:

MyVar./* My Comment */MyTail

Above, you've effectively split the variable name into two separate variable names, although the above REXX statement is legal.

A good, and generally safe, place to put a comment is at the end of a line, to comment that particular line. Alternately, you can put a comment on its own lines (although this may cause REXX to use a little more memory than the preceding suggestion).

Comments are very useful to put helpful remarks explaining your REXX instructions to other people looking at your script. And they can help you more quickly remember what some instructions do, if you haven't edited a script in awhile.

Note: Reginald allows using a semi-colon to indicate that everything after the semi-colon, up to the end of the line, is a comment. To enable this feature, use SEMICOMMENT option.