Please enable JavaScript to view this site.

 

Insert comments instructions in your code to remind yourself, and possibly other users, of what you were doing when you wrote this code. The compiler ignores comments entirely, they are solely there for the user's benefit.

 

There are 2 types of comments.

 

End of the line

End of the line comments are useful to indicate the use or meaning of the entire line. They begin with a double slash // and comment-out the rest of the line.

nWeekday = 5 // end of line comment

Closed

Closed comments are delimited by curly braces { and }. You can insert them anywhere in your code. They are useful to give information about a detail of a code line. For example you may use them to explain some numerical value, or what a variable stands for (although your variable names should be explicit).

nWeekday {the day} = 5 {Friday; closed comment}

 

Generally you should start writing any macro by writing the outline of what the macro is to accomplish, using pseudo-code in comments. This is a powerful way of separating the logic of your code from its implementation details.

 


Topic 108197, last updated on 18-Apr-2020