Page 1 of 1
Editing code... your preferred way?
Posted: Wed May 18, 2016 2:34 pm
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.
Re: Editing code... your preferred way?
Posted: Wed May 18, 2016 2:42 pm
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)
Re: Editing code... your preferred way?
Posted: Wed May 18, 2016 3:05 pm
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
Re: Editing code... your preferred way?
Posted: Wed May 18, 2016 3:17 pm
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.
Re: Editing code... your preferred way?
Posted: Wed May 18, 2016 6:08 pm
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!!!
Re: Editing code... your preferred way?
Posted: Wed May 18, 2016 6:41 pm
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.
Re: Editing code... your preferred way?
Posted: Thu May 19, 2016 8:39 am
by Hippogriff
Even the standard Rules Editor at least allows you to change the font.
I don't want a pair of binocular glasses

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?
Re: Editing code... your preferred way?
Posted: Thu May 19, 2016 12:36 pm
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

Re: Editing code... your preferred way?
Posted: Sun May 22, 2016 9:39 am
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.
Re: Editing code... your preferred way?
Posted: Tue Sep 06, 2016 9:13 pm
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!
Re: Editing code... your preferred way?
Posted: Wed Sep 07, 2016 2:59 am
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.
Re: Editing code... your preferred way?
Posted: Wed Sep 07, 2016 3:00 am
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.
Re: Editing code... your preferred way?
Posted: Wed Sep 07, 2016 4:44 am
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?
Re: Editing code... your preferred way?
Posted: Wed Sep 07, 2016 5:07 am
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.