Comments

From Scriptwiki
Revision as of 23:47, 8 June 2007 by Albie (talk | contribs) (Adding Comments article)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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'
*/

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.

Note

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.

This is where multi-blocks and single line commends differ when it comes to parsing concatenated commands.

Commands | ;Comment | Commands2