Comments: Difference between revisions
Adding Comments article |
Added information about nested comments |
||
Line 16: | Line 16: | ||
*/ Since this line did, it is taken as the last line comment line. | */ Since this line did, it is taken as the last line comment line. | ||
== | == Notes == | ||
As you can see from the above example, commends are generally line based and a commend is used to comment the whole line, including the line to end the comment block. | As you can see from the above example, commends are generally line based and a commend is used to comment the whole line, including the line to end the comment block. | ||
The only exception to this rule is when you start a multi-line commend block from a concatenated line, as illistrated below: | The only exception to this rule is when you start a multi-line commend block from a concatenated line, as illistrated below: | ||
Commands | /* Comment | Comment2 | Commands | /* Comment | Comment2 | ||
Commands2 | Commands2 | ||
In the above example the | is taken as a comment, nothing after the /* is taken as anything other than a comment. | In the above example the | is taken as a comment, nothing after the /* is taken as anything other than a comment, with the exception of a line starting a new comment. | ||
If you open a new comment inside a comment, that too must be closed before you can again issue commands. | |||
Commands | |||
/* Comment line one | |||
/* Comment line two | |||
Comment line three | |||
*/ Comment line four | |||
Commend live five | |||
*/ Comment line six | |||
Commands2 | |||
Multi-blocks and single line commends differ when it comes to parsing concatenated commands. | |||
Commands | ;Comment | Commands2 | Commands | ;Comment | Commands2 | ||
[[Category:Remote]] | [[Category:Remote]] |
Revision as of 22:57, 8 June 2007
Comments are used to 'comment out' code that you don't wish be used inside your scripts.
;Single line command /* This is a multi line comment and all code between the open comment And the close comment will be 'commented out' */
Commends are used to comment out whole lines, even the multi-line comments are used to commend whole lines, which is the main difference between mIRC's commenting system and most other common languages that use /*...*/
Examples
;Comment line /* This is a comment. */ We're still in a comment since the line above didn't start with */ So it didn't acknoledge it as the end of the comments. */ Since this line did, it is taken as the last line comment line.
Notes
As you can see from the above example, commends are generally line based and a commend is used to comment the whole line, including the line to end the comment block. The only exception to this rule is when you start a multi-line commend block from a concatenated line, as illistrated below:
Commands | /* Comment | Comment2 Commands2
In the above example the | is taken as a comment, nothing after the /* is taken as anything other than a comment, with the exception of a line starting a new comment. If you open a new comment inside a comment, that too must be closed before you can again issue commands.
Commands /* Comment line one /* Comment line two Comment line three */ Comment line four Commend live five */ Comment line six Commands2
Multi-blocks and single line commends differ when it comes to parsing concatenated commands.
Commands | ;Comment | Commands2