Useful TM1 language highlighter for Notepad ++

Post Reply
User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Useful TM1 language highlighter for Notepad ++

Post by macsir » Thu Jun 21, 2012 3:31 am

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 649 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/

User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Thu Jun 21, 2012 4:47 am

A little modification. This is the latest one.
Attachments
TM1.zip
(2.35 KiB) Downloaded 400 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/

Wim Gielis
MVP
Posts: 1718
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis » Thu Jun 21, 2012 9:30 am

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
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Thu Jun 21, 2012 10:03 pm

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 » Fri Jun 22, 2012 3:50 pm

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.JPG
Notepad++ IF and While
Notepad.JPG (4.43 KiB) Viewed 7038 times
Cheers!
Rizwan Kaif

User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Mon Jun 25, 2012 1:45 am

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 649 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/

Wim Gielis
MVP
Posts: 1718
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis » Mon Jun 25, 2012 11:52 am

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
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

lotsaram
MVP
Posts: 3076
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TM1, CX
Version: TM1 10.2.2 PA 2.0x
Excel Version: 2010 2013 365
Location: Switzerland

Re: Useful TM1 language highlighter for Notepad ++

Post by lotsaram » Mon Jun 25, 2012 12:16 pm

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: 1718
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis » Mon Jun 25, 2012 3:56 pm

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
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Mon Jun 25, 2012 10:15 pm

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 » Sat Jul 27, 2013 1:05 pm

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
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Sun Jul 28, 2013 10:54 pm

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: 1718
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by Wim Gielis » Thu Feb 06, 2014 9:23 am

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
http://www.wimgielis.com ==> 105 TM1 articles and a lot of custom code
Newest blog article: Looping over input files

User avatar
macsir
Community Contributor
Posts: 514
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: Useful TM1 language highlighter for Notepad ++

Post by macsir » Fri Feb 07, 2014 1:32 am

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