Page 1 of 1

How to get - TI parameters labels and inputs on run time

Posted: Fri Jul 13, 2018 11:43 am
by Ashleigh W
Is there a way or function to dynamically pull all parameters labels and inputs on runtime in TI Process?
For example GetProcessName(0) returns the current process being executed.

Re: How to get - TI parameters labels and inputs on run time

Posted: Fri Jul 13, 2018 12:28 pm
by tomok
Ashleigh W wrote: Fri Jul 13, 2018 11:43 am Is there a way or function to dynamically pull all parameters labels and inputs on runtime in TI Process?
For example GetProcessName(0) returns the current process being executed.
I'm not sure what you are asking but you don't need to "pull" the input value to a parameter at runtime, it's going to be stored in the parameter variable. For instance, you could print out the value in a parameter at runtime by putting the following code in your prolog (if the param is string, if it is value you need to wrap in a NumberToString):

Code: Select all

ASCIIOUTPUT('MyFileName', 'The value in pParam1 is' | pParam);
If you are asking if there is a collection you can access to dynamically get a list of the parameters, like VB has collections, then the answer is no.

Re: How to get - TI parameters labels and inputs on run time

Posted: Fri Jul 13, 2018 12:46 pm
by Ashleigh W
@tomok, thanks for quick reply.
I have 300+ processes that have multiple parameters (some 2,3 or some 5 or 6) depending on process requriements... I am wanting to include generic code that can store all the parameters passed and the input values to my cube for logging.

Re: How to get - TI parameters labels and inputs on run time

Posted: Fri Jul 13, 2018 2:30 pm
by Wim Gielis
Hello,

It does not exist.

The only thing you could do is, and it will be not easy and cumbersome too,
is set up a cube containing all processes and their parameter names (in the good sequence).
Then for your generic code, loop over the parameters of the given process (you can do that in the separate cube),
from that cube you retrieve the parameter name, and the Expand function can be used to get the parameter value at run time.

If you look on the forum in the 'Useful code' subforum, you can find code of mine to create and maintain such a cube.

In general, while I see the benefit of the approach, there will be disadvantages too. For one, you need to make sure the second cube is always up to date, with every change in parameters and/or processes.

Wim

Re: How to get - TI parameters labels and inputs on run time

Posted: Mon Jul 16, 2018 9:34 am
by Ashleigh W
@ Wim Gielis, thanks for your input and suggestions/idea. appreciate your help. :thumbsup: