Page 1 of 1

Commenting multiple lines

Posted: Tue Jun 24, 2014 10:27 am
by deepakjain2020
Hi All,

Using "#" we can comment lines in rule editor
Is there a way for commenting many lines in a single time?

In other lang we use to give

/*comment line 1
line2
line3*/

Do we have anything similar in rules editor?

Regards,
Deepak Jain

Re: Commenting multiple lines

Posted: Tue Jun 24, 2014 10:42 am
by lotsaram
You have given tsql as an example but basically the answer is no, there isn't a multi-line comment facility in the TM1 rules language only # which is the same as -- in tsql. (except # has to be first character of the row).

Depending on the rules editor you just select multiple rows at once and via right mouse click or menu choose "comment selection" which automatically inserts # as the first character of every line in the selection. Advanced rule editor and performance modler both have this.

For TI code you can achieve the same by using an if statement to skip a block.
IF( 1 = 2 );
<code block to "comment">
EndIF;

Re: Commenting multiple lines

Posted: Tue Jun 24, 2014 10:49 am
by deepakjain2020
Thanks :)

Re: Commenting multiple lines

Posted: Tue Jun 24, 2014 3:11 pm
by Duncan P
lotsaram wrote:(except # has to be first character of the row)
I think it works with # as the first non-blank, which allows for indenting, but I seem to remember that a tab character prevents it from being a comment. Please correct me if I'm talking balls again.

c.f. this rather sweet example

Code: Select all

[] = LONG('
    # a comment after 4 spaces
');
which puts 4 in every numeric cell of the cube.