Commenting multiple lines

Post Reply
deepakjain2020
Regular Participant
Posts: 152
Joined: Sat May 25, 2013 10:32 am
OLAP Product: TM1
Version: 9.5.2; 10.2.2
Excel Version: 2007

Commenting multiple lines

Post 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
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Commenting multiple lines

Post 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;
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
deepakjain2020
Regular Participant
Posts: 152
Joined: Sat May 25, 2013 10:32 am
OLAP Product: TM1
Version: 9.5.2; 10.2.2
Excel Version: 2007

Re: Commenting multiple lines

Post by deepakjain2020 »

Thanks :)
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Commenting multiple lines

Post 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.
Post Reply