Page 1 of 1

Comment-Only Scripts

Posted: 05 Apr 2014 14:45
by 98b427af
I use scripts for documentation, via /*comments*/. These "scripts" have nothing else in them but a single, usually long, comment.

To avoid a syntax error I must include one line of code. I always use this at the end:

Code: Select all

null; //syntax requirement
Because these comment scripts are not meant to be executed that code is superfluous. Technically speaking, there is nothing syntactically wrong with having only a comment, so I suggest removing the code requirement, to permit comment-only scripts.

Thanks.

Re: Comment-Only Scripts

Posted: 10 Apr 2014 17:27
by cjrademaker
I appreciate the tip. I have been looking for nice clean way to do this.

Re: Comment-Only Scripts

Posted: 11 Apr 2014 16:34
by bichlepa
I don't like the behaviour that there is an error if a script contains nothing, too. Sometimes it is useful to comment out everything from the script when debugging a flow.