Use comments in command or application files to provide internal program documentation.
There are a few comment designators: "--", "{ }", and "*( )".
1. | A "--" comment can be used only on a single line either by itself or following a command. |
To comment an individual line, add two hyphen characters "-" to the beginning of the line. A carriage return at the end of the line indicates the end of the text for a comment that begins with two hyphens. In R:BASE Editor, the syntax highlighting will alter the display and change the font color to pink and the style to italicized. In the following example;
CLEAR VAR vResult
the command will become:
--CLEAR VAR vResult
2. | A "{ }" comment may share a command line with a command, occupy a line itself, or extend over multiple command lines. |
This designator is the recommended option with the latest releases of R:BASE, as it helps in avoiding any confusion when using parentheses with your R:BASE expressions. The set of squiggly brackets "{}", with the desired commented text or commands enclosed within the squiggly brackets will comment the text. In the following example;
PLUGIN RPDFMerge 'vResult +
|ACTION MERGE +
|DOC_LIST_FILE PDFFilesToMerge.LST +
|SHOW_SETUP_DIALOG ON +
|OUTPUT_FILE OneBigMergedFile.PDF '
the command(s) will become:
{
PLUGIN RPDFMerge 'vResult +
|ACTION MERGE +
|DOC_LIST_FILE PDFFilesToMerge.LST +
|SHOW_SETUP_DIALOG ON +
|OUTPUT_FILE OneBigMergedFile.PDF '
}
Keep in mind that any command(s) that are embedded within a multiple-line comment will not be executed.
3. | A "*( )" comment may share a command line with a command, occupy a line itself, or extend over multiple command lines. |
Another use of characters that will comment your code is the asterisk character preceding a set of parentheses "*()", with the desired commented text or commands enclosed within the parentheses. R:BASE interprets text following an asterisk and left parenthesis as a comment until a closing right parenthesis is reached. If the right parenthesis is not entered, R:BASE responds with a continuation prompt (+>). Enter a closing parentheses until you are returned to the R> Prompt, or other processing. In the following example;
PLUGIN RPDFMerge 'vResult +
|ACTION MERGE +
|DOC_LIST_FILE PDFFilesToMerge.LST +
|SHOW_SETUP_DIALOG ON +
|OUTPUT_FILE OneBigMergedFile.PDF '
the commands will become:
*(
PLUGIN RPDFMerge 'vResult +
|ACTION MERGE +
|DOC_LIST_FILE PDFFilesToMerge.LST +
|SHOW_SETUP_DIALOG ON +
|OUTPUT_FILE OneBigMergedFile.PDF '
)
Although this option is still supported in R:BASE, it is now recommended that you use the squiggly bracket "{}" method above. Keep in mind that any command(s) that is embedded within a multiple-line comment will not be executed.
Using Comment Designators
•Although used primarily in command files, you can enter a comment at the R> Prompt.
•If you place a comment on the same line as a command, leave at least one space between the comment and the command so the comment is not interpreted as part of the command.
Restrictions on Using the Comments
•Do not include comments within the text of an ASCII menu file or a menu block because the comment will be read as part of the file.
•Do not embed comments within multi-line commands between continuation characters.
•Once starting a comment with a { bracket, everything except other left and right brackets is ignored until the matching right bracket.
•Once starting a comment with *(, everything except other left and right parentheses is ignored until the matching right parenthesis.