Page 1 of 1

How to comment out a block of code?

Posted: Wed Jul 11, 2007 12:19 am
by derek
In debugging or modifying scripts, it is often useful to "comment out" a block of code, so that it will be ignored (treated as a comment) until I decide to reactivate it. I know that I can turn any single line of code into a comment, by adding -- (double dash) at the beginning. However, this is tedious and error-prone, if I want to comment out twenty or thirty lines of a script at a time.

Is there a simple way to mark a block of code, so that it will be treated as a comment?

Thanks,

Derek

Posted: Wed Jul 11, 2007 12:37 am
by Lynn P.
Hi Derek ~

Here are a couple of ways...
In the script editor, drag and select the lines you want to comment out temporarily, then choose "Comment" from the Script menu.

Or...

You can put /* at the start of the section of code and */ at the end.

Lynn P.

Posted: Wed Jul 11, 2007 12:46 am
by derek
Thank you, Lynn. This is just what I was looking for.

Derek