Editing code... your preferred way?

Post Reply
User avatar
Hippogriff
Posts: 48
Joined: Thu Nov 19, 2015 4:02 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2012

Editing code... your preferred way?

Post by Hippogriff »

Forgive me for asking this, but I've been hanging around here for a bit now and one of the things I do a fair bit of (I'd call it tinkering) is writing TI code in Architect.

So, a quick question - does anyone actually use that editor? I call it an editor, but it's a real stretch of the imagination. Forget that it has no syntax highlighting or code completion abilities, forget the fact that it doesn't even have line numbers - but, instead, offers a button "Goto Line..." which is as much use as a chocolate teapot, let's focus on the immutable font that was chosen for the code... what is that - 8pt Tahoma? Please just give me the choice of changing that to 10pt Courier or something monospaced. I can't even tell what is a comma and what is a period in the code I'm looking at, it's so small (27" monitor) and my eyes are so bad (truly!) - I have to delete it and retype over it just to make sure... or I dump the whole thing into a proper text editor... remembering to press CTRL-C twice to copy text! Yes, it still catches me out... I'm forever pasting 'something else' because Architect refuses to let me have it on the first time of asking.

Yet, the impression I largely get from reading this site is that folk prefer Architect over Performance Modeler... what do you kind folk use for editing your TI, it can't be this, right?

I've been searching for "configuration file tm1 architect font" all day... but it really seems that it's fixed.
--
Cheers, Hippo
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Editing code... your preferred way?

Post by Wim Gielis »

Hello,

I use Notepad++ and I blogged about it:
http://users.skynet.be/fa436118/wim/tm1 ... d++_EN.htm
(this is the direct link to the page)
Best regards,

Wim Gielis

IBM Champion 2024
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
User avatar
gtonkin
MVP
Posts: 1211
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Editing code... your preferred way?

Post by gtonkin »

I have just conformed over the years to using the editor as is and habit dictates doing Ctrl+C at least 3 times in succession before moving to where I want to paste.
If I have quite a lot of editing to do where variables are added or order changed etc. I go one scarier and use VIM (VI for windows) and edit the .pro file, update the control codes and row counts.
Performance Mangler is not for me - too old or too old fashioned or possibly both.

These are practical for developers with eyesight issues
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: Editing code... your preferred way?

Post by TrevorGoss »

We have got use to it over the years. One thing we have to do which demonstrates how unfair the editor can be for developers, if we want to know the line number, for comments or to let someone else know where to look, I will make a syntax error, try and save it and the editor tells me where the syntax error is and therefore what line it is.

Performance Modeler gets dogs abuse on this forum and rightly so but once it improves (drastically) it may well be the case that more developers move onto it.
Last edited by TrevorGoss on Mon Aug 15, 2016 8:03 am, edited 1 time in total.
User avatar
jim wood
Site Admin
Posts: 3953
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Editing code... your preferred way?

Post by jim wood »

I just use what's there. What kind of challenge would it be if every time I typed something wrong it would be highlighted. For me personally having to use such a basic tool made me develop best practice approaches when creating the code to make finding mistakes easier. If you do that then using any fancy editor doesn't really give you that much benefit IMHO. After all, back in the day we didn't have fancy editors when writing code. (Showing my age a bit there)

Not to sound too much like my Dad but all the short cuts make people lazy. My good I'm morphing in to my Dad!!!
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Wim Gielis
MVP
Posts: 3128
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Editing code... your preferred way?

Post by Wim Gielis »

jim wood wrote:I just use what's there. What kind of challenge would it be if every time I typed something wrong it would be highlighted. For me personally having to use such a basic tool made me develop best practice approaches when creating the code to make finding mistakes easier. If you do that then using any fancy editor doesn't really give you that much benefit IMHO. After all, back in the day we didn't have fancy editors when writing code. (Showing my age a bit there)

Not to sound too much like my Dad but all the short cuts make people lazy. My good I'm morphing in to my Dad!!!
Thank you for your feedback Jim.

Personally I prefer to hit Ctrl-D to duplicate the current line of code (copy/paste), rather than:

- press Home key
- press Shift key
- press End key
- press Ctrl-C, C, C
- press End key
- press arrow-right key
- press Ctrl-V

And that's 1 example.

Color highlighting and function autocompletion are another option I cannot do without.
Double-clicking a function or word highlights all occurrences of that string in the whole document.
Changing a rectangular (columnar kind of selection) is what I do a lot.
Being able to find and replace.
See where brackets don't match, and so on.

I cannot spend too much time on TI processes or rules, in TM1 projects where the number of days are counted.
In other projects I also prefer to do more efficient work than losing time in TI.
Time is money ;-)

I prefer Notepad++ but maybe there are other tools out there.
Best regards,

Wim Gielis

IBM Champion 2024
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
User avatar
Hippogriff
Posts: 48
Joined: Thu Nov 19, 2015 4:02 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2012

Re: Editing code... your preferred way?

Post by Hippogriff »

Even the standard Rules Editor at least allows you to change the font.

I don't want a pair of binocular glasses :D I can read what's on this forum quite well on my monitor... the problem is solely with Architect and the immutable font imposed.

Well, maybe not solely... but I can read stuff in email, Notepad++, Textpad, browsers and - well, anything else. Being a newbie to this it's definitely got me scratching my head - what was the thought process (no pun intended) there?
--
Cheers, Hippo
User avatar
garry cook
Community Contributor
Posts: 209
Joined: Thu May 22, 2008 7:45 am
OLAP Product: TM1
Version: Various
Excel Version: Various

Re: Editing code... your preferred way?

Post by garry cook »

Remembering to press CTRL-C twice to copy text! Yes, it still catches me out... I'm forever pasting 'something else' because Architect refuses to let me have it on the first time of asking.
Can't remember who first raised this so apologies for the lack of credit but if you roll the C on a Ctrl+C it works first time every time - ie, Press Ctrl, Press C, Release C (with Ctrl still held down) then release Ctrl and it's copied first time. Amazing how quick you get used to that.

My main frustration in terms of Shortcuts is when you Alt & Tab from the rule editor to cycle applications and it applies the Tab into the rule file which at best adds a useless indent or (much worse) replace highlighted text with an indent which can result in accidentally saving a rule file with a chunk of logic missing if you're not paying attention. Considering Alt & Tab is such a staple shortcut it's ridiculously annoying that :evil:
Bakkone
Posts: 119
Joined: Mon Oct 27, 2014 10:50 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: Editing code... your preferred way?

Post by Bakkone »

Most of the time I use Performance Modeler when editing rules. Most of my old colleagues laughed at me for doing so, but I just find it to be the middle way between having a good editor such as Notepad++ and something that can compile and test the code such as Architect. I do find myself writing the code in PM, then structuring it Notepad++ quite often.

For TI-processes I always use Architet cause for some reason PM just breaks everything.


And don't forget to try out Architects "advanced editor". Its a bit slower but maybe it suits you.
tm1box
Posts: 2
Joined: Tue Sep 06, 2016 5:59 am
OLAP Product: tm1
Version: 10.2
Excel Version: microsoft

Re: Editing code... your preferred way?

Post by tm1box »

gtonkin wrote:I have just conformed over the years to using the editor as is and habit dictates doing Ctrl+C at least 3 times in succession before moving to where I want to paste.
If I have quite a lot of editing to do where variables are added or order changed etc. I go one scarier and use VIM (VI for windows) and edit the .pro file, update the control codes and row counts.
Performance Mangler is not for me - too old or too old fashioned or possibly both.

These are practical for developers with eyesight issues
Hi gtonkin -

How are you able to update control codes?

Thanks!
User avatar
gtonkin
MVP
Posts: 1211
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Editing code... your preferred way?

Post by gtonkin »

tm1box wrote:How are you able to update control codes?
If you open the .pro file in a text editor, you will see that there are various control codes
Depending on the code, there is a number afterwards referring to the number of rows associated with the control code e.g. 572 for prolog may have 10 rows of code.
If you are going to manually add lins to the prolog section, you will need to count the total lines and change the 572,10 to 572,x.
The main resason I edit the .PRO file is to either add Variables or change the order. Here you will notice that there are a few control codes that have to be updated together i.e. if you add a new variable, you will need to update 577 (variable names); 578 (2=String,1=Numeric); 579 (Variable number); 580 (always 0); 581 (always 0); 582 (variable definition-copy and paste as there may be non-ascii codes here) - if you re-arrange or add, update in each of these sections.
This will be a bit of trial and error to begin with so make sure you have backups.
whitej_d
Community Contributor
Posts: 103
Joined: Mon Sep 05, 2011 11:04 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Re: Editing code... your preferred way?

Post by whitej_d »

I will add that I have been guilty in the past of building things which are far too complex, and will probably be guilty of it in the future too! Don't want to sound like I'm preaching, but the drive should be towards simplifying things, not towards making it easier to do complicated things.
tm1box
Posts: 2
Joined: Tue Sep 06, 2016 5:59 am
OLAP Product: tm1
Version: 10.2
Excel Version: microsoft

Re: Editing code... your preferred way?

Post by tm1box »

gtonkin wrote:
tm1box wrote:How are you able to update control codes?
If you open the .pro file in a text editor, you will see that there are various control codes
Depending on the code, there is a number afterwards referring to the number of rows associated with the control code e.g. 572 for prolog may have 10 rows of code.
If you are going to manually add lins to the prolog section, you will need to count the total lines and change the 572,10 to 572,x.
The main resason I edit the .PRO file is to either add Variables or change the order. Here you will notice that there are a few control codes that have to be updated together i.e. if you add a new variable, you will need to update 577 (variable names); 578 (2=String,1=Numeric); 579 (Variable number); 580 (always 0); 581 (always 0); 582 (variable definition-copy and paste as there may be non-ascii codes here) - if you re-arrange or add, update in each of these sections.
This will be a bit of trial and error to begin with so make sure you have backups.
Thanks for the clarification but when you manually edit the process file are you also updating the encrypted section (565) or is that not necessary? I assume after you manually edit you just restart the server for it to take effect?
User avatar
gtonkin
MVP
Posts: 1211
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Editing code... your preferred way?

Post by gtonkin »

tm1box wrote:Thanks for the clarification but when you manually edit the process file are you also updating the encrypted section (565) or is that not necessary? I assume after you manually edit you just restart the server for it to take effect?
Never update the encrypted section, just restart server.

p.s. in the early days I found it easier to copy sections 577 to 582 into columns in Excel, make my changes, update the counts etc. then paste back-this ensured that each section was the correct length (no. rows) etc.
Post Reply