Scripting Unleashed - Scripting Comments

Top  Previous  Next

Some people write (and draw) comments in books, some use post-it notes... and you'll save paper and write comments in MMB ! Either to separate parts of code lines, describe code sections or even make reminders - in Script Editor you're able to write whatever you want under only one condition; you must put single or double (recommended) asterisk at beginning of the line where you'll write comments. It looks like this:

** Hey ! Now I can write whatever I want !

From 4.9.7 you can use also a comment block! With this sequence of characters /* code */ you can comment multiple lines of code at once.

/* first line of code

second line of code

third line of code */

 

Note that the /* sequence must be used as the very first characters of the first line of code you would like to comment (not counting the spaces) and the ending sequence */ as the very last characters of the last line of code you would like to comment. This block comment cannot be used inside the same line of code!

 

There's a case when comments will be added automatically: if MMB notices mistakes in code lines you wrote, it won't keep bugging you about errors, but simply "isolate" those lines using asterisks, making them - comment lines. Once you correct errors, simply remove comment asterisks and MMB will use these lines again.

In already mentioned code line preview, you'll notice comment in the very first line:

CodeLines