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 |
Code // Comment |
Slash-and-asterisk method
1 |
/* Comment */ |
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 right of the |
Cannot extend to multiple lines |
Slash and asterisk |
/*…*/ |
Designate the text between the markers as a 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 the section called “Modifying comments” in Users Guide.
Examples
Double-slash method
1 2 3 4 5 6 7 |
// This entire line is a comment. // This entire line is another comment. amt = qty * cost // Rest of the line is comment. // The following statement was commented out so that it // would not execute. // SetNull(amt) |
Slash-and-asterisk method
1 2 3 4 5 6 7 8 9 |
/* This is a single-line comment. */ /* This comment starts here, continues to this line, and finally ends here. */ A = B + C /* This comment starts here. /* This is the start of a nested comment. The nested comment ends here. */ The first comment ends here. */ + D + E + F |