General EQWatcher Concepts > Venturing into the Unknown > Comments
Comments are important for helping yourself and others understand your code. A complicated script with lots of strange looking symbols and names may mean nothing to someone looking at the code, without a brief explanation.
The EQWatcher Advanced compiler provides for two types of commenting. One type is single-line commenting, that makes all information after a specified point be regarded as a comment, up to the next line of code. The other type is block commenting, which makes all information starting at a specific point be regarded as a comment, up to the marked end of the block.
Single line comments start with two slashes: //
Block comments start with /* and end with */
By looking at the core script you will notice each file has a few lines of comments at the top with a short description. This uses single line comments:
//
// EQWatcher Core Script
// Written by EQWatcher
// EQWatcher2001@hotmail.com
//
//
They can also follow lines of code, for example:
function main() // This function will be run when the script loads
{
}
Block comments can look like this:
function main(/* this is a legal block comment */)
{
}
or even this:
/*
function main()
{
}
*/
The second example of a block comment would obviously remove the entire main function as if it were only a comment. The first example would be treated exactly like function main()....