Request for Turbo Integrator to support For / Next syntax.

Post Reply
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Request for Turbo Integrator to support For / Next syntax.

Post by Alan Kirk »

Since we have no other way of knowing what enhancement requests have been logged by everyone, I for one am going to put mine in here. And so to today's, which has gone in as 11-81515781:
I'm asking this one more in hope than expectation. At present the only looping syntax we have (other than that driven by the data source itself) is While / End. That means that we need to initialise the value of a counter variable, and under no circumstances forget to increment that variable in the course of the loop lest we hang our server.

After writing the umpteenth hundredth loop of this kind that I've written since I started churning out TI code, it occurred to me (also for the umpteen hundredth time) that life would be substantially easier if there was the option of a For / Next loop available in the TI language.

Since I've no way of knowing whether anyone has requested that... I'm going to.
I suppose that I could have gone for the gold and asked for a Step argument to be added, but in truth I doubt that the one that I've submitted will be implemented anyway. My suspicion is that it'll end up kicked down to Jira and then forgotten about until at least the 4th holographic version of TM1 is available.

(At which point it will be closed due to "no response from customer"...)
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Mike L
Posts: 58
Joined: Fri Jun 13, 2008 4:01 pm

Re: Request for Turbo Integrator to support For / Next syntax.

Post by Mike L »

Yes, For...Next would be nice enough. (But I remember an old ALGOL60 compiler that implemented it so inefficiently many people would not use it.)

My biggest wish for language extension: Who has not written TI scripts that have the same snippet repeated over and over with variations that, in a "modern" language, could have been a subroutine or function with parameters? (By "modern" I mean up to the middle of the 20th century.) It would be much easier to write, and much more robust.

Expectation? It doesn't have a snowball's chance in H*** of happening as long as TI is conceived of as a "process script" (whatever that means) rather than a "programming language."
User avatar
Mike Cowie
Site Admin
Posts: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: Request for Turbo Integrator to support For / Next syntax.

Post by Mike Cowie »

Mike L wrote:My biggest wish for language extension: Who has not written TI scripts that have the same snippet repeated over and over with variations that, in a "modern" language, could have been a subroutine or function with parameters? (By "modern" I mean up to the middle of the 20th century.) It would be much easier to write, and much more robust.
Mike,

I think you'll find that the current thinking by the powers that be at IBM Cognos is that they already support this. After all, you can call other TI processes using ProcessExecute, which is like calling a function as far as they're concerned. I have actually used this to some extent and, depending on the situation, it can be of some use in having reusable "scripts".

The reality, though, is that this isn't an adequate substitute for a true subroutine or function. First, there seems to be quite a bit of overhead involved in calling other TI processes many times. Not to mention the mess that you end up with in your Server Message Log if you call a TI process many times. My other big gripe with this approach is the poor ability to return values/information from another TI process. You have the standard process return codes, but there isn't any way to easily pass a value back from one process to another - we have Global Variables, but I can't say I love those as the only solution to this problem.

My other complaint with the ProcessExecute approach is that it isn't capable of supporting/enforcing an interface or compatibility between a process and a sub-process. For example, I can create a "function" process called "Security - Add User" to add a new user to the TM1 Server and initially I have 1 parameter: UserID. This works just fine, but, if I enhance my original "Security - Add User" process to allow the specification of a Group or some other user attributes and I have multiple TM1 Servers how do I know which version of "Security - Add User" I have on a particular server? I don't without some digging and/or good practices to always put an artificial version number or timestamp in the Prolog, for example, when ever an enhancement is made. Taking it a step further, it would be nice if my "parent" process could know that something is "different" and possibly alert you to that fact.

I would also love to be able to group TI processes into folders independent of the whole Application folder concept. And, of course, regardless of whether or not you're going to allow some sort of subroutine calling it sure would be nice to have richer debugging tools for TI.

Sorry for the rambling thoughts - at least you know that you aren't alone in your wishes for a more robust set of development functionality for TI.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Mike L
Posts: 58
Joined: Fri Jun 13, 2008 4:01 pm

Re: Request for Turbo Integrator to support For / Next syntax.

Post by Mike L »

I know, I know: it's Turing equivalent, so what else could I possibly want? You got my point exactly. Alas, it would not only be a huge paradigm-shift, it would be a major undertaking to implement and support. If I were in IBM Cognos shoes, I probably couldn't justify it either. So we carry on with cut-and-paste coding as if we were using assembly language without a macro processor. At least the result gets to run on an awesome engine.
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Request for Turbo Integrator to support For / Next syntax.

Post by Alan Kirk »

Mike L wrote:I know, I know: it's Turing equivalent,
For some horrible reason (possibly reading too much Roger Penrose) I (mis)read that as "Turing Test".

I'm not sure that I'd WANT T.I. to be able to pass the Turing test.
------------------------------------------------------------------------
Me: l_ProdCnt = ElCompN('Products', 'Australian Products');
l_ProdIdx = 1

While (l_ProdIdx <= l_ProdCnt);

TI: No.

Me: What do you mean "No"?

TI: I don't want to do that loop.

Me: Why not?

TI: I just don't, OK? That's all I am to you, just some loop processor. Well let me tell you something mister, I have feelings. FEELINGS, do you understand???

Me: You're a scripting language, this is your whole purpose in life!!!

TI: You think that just because you pay my licencing fee you can USE me like this??? I want to go places, meet people, when was the last time you took me out to dinner???

Me: YOU'RE CODE RUNNING ON A GORRAM WINDOWS SERVER, HOW COULD *ANYONE* TAKE YOU OUT TO DINNER?!?!

TI: See??? You just treat me as if I'm an object!!! I'm not even object ORIENTED!
------------------------------------------------------------------------

No, if that's the alternative, I'll stick with having to do While loops thanks...
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply