Comments
Description
You can use comments to document your scripts and prevent
statements within a script from executing. There are two methods.
Syntax
Double-slash method
|
1 |
<span>Code</span> // <span>Comment</span> |
Slash-and-asterisk method
|
1 |
/* <span>Comment</span>  */ |
Usage
The following table shows how to use each method.
|
Method |
Marker |
Can use to |
Note |
|---|---|---|---|
|
Double slash |
// |
Designate all text on the line to the |
Cannot extend to multiple |
|
Slash and asterisk |
/*…*/ |
Designate the text between the markers Nest comments |
|
Adding comment markers
In Script views and the Function painter, you can use the
Comment Selection button (or select Edit>Comment Selection
from the menu bar) to comment out the line containing the cursor
or a selected group of lines.
For information about adding comments to objects
and library entries, see the PowerBuilder Users Guide.
Examples
Double-slash method
|
1 |
// This entire line is a comment.<br>// This entire line is another comment.<br>amt = qty * cost // Rest of the line is comment.<br> <br>// The following statement was commented out so that it <br>// would not execute.<br>// SetNull(amt) |
Slash-and-asterisk method
|
1 |
/* This is a single-line comment. */<br> <br>/* This comment starts here,<br>continues to this line,<br>and finally ends here. */ |
|
1 |
<br>A = B + C /* This comment starts here. <br>/* This is the start of a nested comment.<br>    The nested comment ends here. */ <br>The first comment ends here. */ + D + E + F |