Useful TM1 language highlighter for Notepad ++

A forum to post information about tools which are free and open source.
Post Reply
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Useful TM1 language highlighter for Notepad ++

Post by macsir »

I worte it and it supports all languages up to 9.5.2 in TM1 (Process scripts, rules etc.)
You can use latest Notepad++ to import this UDL xml file into it and it would be there in Language menu for you to select and highlight.
In Notepad ++, View -> User Defined Dialogue... -> Import
Attachments
TM1.zip
Notepad ++ TM1 language
(2.35 KiB) Downloaded 1799 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

A little modification. This is the latest one.
Attachments
TM1.zip
(2.35 KiB) Downloaded 1303 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Wim Gielis
MVP
Posts: 2932
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.14
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis »

Thank you, nice addition !

Certainly the sections on IF-ENDIF;
Too bad a second section for WHILE-END; does not seem possible (I tested a few minutes).
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly https://github.com/wimgielis
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

Wim Gielis wrote:Thank you, nice addition !

Certainly the sections on IF-ENDIF;
Too bad a second section for WHILE-END; does not seem possible (I tested a few minutes).
Yeah, I have thought about that but looks like notepad++ only supports one section. Anyway, WHILE-END is not so widely used as IF-ENDIF;
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
rkaif
Community Contributor
Posts: 328
Joined: Fri Sep 05, 2008 6:58 pm
OLAP Product: IBM Cognos TM1
Version: 9.1 or later
Excel Version: 2003 or later

Re: Useful TM1 language highlighter for Notepad ++

Post by rkaif »

macsir wrote: Yeah, I have thought about that but looks like notepad++ only supports one section. Anyway, WHILE-END is not so widely used as IF-ENDIF;
We can setup While as well as IF at the same time. Please see the attached screen shot.
Attachments
Notepad++ IF and While
Notepad++ IF and While
Notepad.JPG (4.43 KiB) Viewed 72984 times
Cheers!
Rizwan Kaif
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

rkaif wrote:
macsir wrote: Yeah, I have thought about that but looks like notepad++ only supports one section. Anyway, WHILE-END is not so widely used as IF-ENDIF;
We can setup While as well as IF at the same time. Please see the attached screen shot.
Thanks for useful advice. I have added this into latest version and also update some bugs.
Attachments
TM1.zip
(2.36 KiB) Downloaded 1619 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Wim Gielis
MVP
Posts: 2932
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.14
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis »

A nice little thing for TI code in Notepad++, is that you can add commentary signs (see the Edit menu).
Since the commentary sign for TI syntaxis is defined as #, this character is added at the beginning of the line.
This saves me from either manually adding the #, either using the lame workaround of:

IF(1=0);
'code
ENDIF;
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly https://github.com/wimgielis
lotsaram
MVP
Posts: 3572
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Useful TM1 language highlighter for Notepad ++

Post by lotsaram »

Wim Gielis wrote:A nice little thing for TI code in Notepad++, is that you can add commentary signs (see the Edit menu).
Since the commentary sign for TI syntaxis is defined as #, this character is added at the beginning of the line.
This saves me from either manually adding the #, either using the lame workaround of:

IF(1=0);
'code
ENDIF;
Oh c'mon it's a brilliant workaround! :lol:
Wim Gielis
MVP
Posts: 2932
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.14
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis »

lotsaram wrote:
Wim Gielis wrote:A nice little thing for TI code in Notepad++, is that you can add commentary signs (see the Edit menu).
Since the commentary sign for TI syntaxis is defined as #, this character is added at the beginning of the line.
This saves me from either manually adding the #, either using the lame workaround of:

IF(1=0);
'code
ENDIF;
Oh c'mon it's a brilliant workaround! :lol:
Yeah Lotsa, you know me by now, always willing to learn new tricks to the community :D :lol:
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly https://github.com/wimgielis
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

Thanks for sharing, useful tricks. ;)
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
SirDuke
Posts: 9
Joined: Thu May 30, 2013 8:46 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2010

Re: Useful TM1 language highlighter for Notepad ++

Post by SirDuke »

Sorry to re-open such old thread with a dumb question :roll:

How do you use the notepad++ for TI editing? Are you copy/pasting related TI's tab all the time? Or are you modifying the *.pro file directly and somehow forcing tm1 server to reload it? Or am I completely missing something???
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

SirDuke wrote:Sorry to re-open such old thread with a dumb question :roll:

How do you use the notepad++ for TI editing? Are you copy/pasting related TI's tab all the time? Or are you modifying the *.pro file directly and somehow forcing tm1 server to reload it? Or am I completely missing something???
I am using copy/pasting related TI's tabs into notepad++ for TI editing only. I never modify the *.pro file directly coz it might corrupt the file and crash the server.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Wim Gielis
MVP
Posts: 2932
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.14
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis »

Hello

I noticed that a structure like IF-ELSEIF-ENDIF will not work correctly regarding collapsing the full IF:
For example:

Code: Select all

If(c = 2);

  a = 0;
  
ElseIf(c = 3);

	b = 0;
  
EndIf;

# commentaar
# other code
If you now collapse the IF with the minus sign to the left of it (in Notepad++) also the 2 lines of commentary will be hidden.

Anyone who can and wants to have a look at this? Macsir of rkaif?

Thanks!

Wim
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly https://github.com/wimgielis
User avatar
macsir
MVP
Posts: 780
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir »

Hi, Wim

I have tested the language settings in NP++ but failed. Although NP++ above 6.2 does support Multipart keywords, it still doesn't work well. So, just use the current best version. Maybe once NP++ goes into version 7, I will try it again.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply