Comments

From Scriptwiki
Jump to: navigation, search

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'
*/

Comments are used to comment out whole lines, even the multi-line comments are used to comment 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 acknowledge 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, comments are generally line based and a comment 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 comment block from a concatenated line, as illustrated 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
Comment live five
*/ Comment line six
Commands2

Multi-blocks and single line comments differ when it comes to parsing concatenated commands.

Commands | ;Comment | Commands2