Adressing functions dynamically

3 posts / 0 new
Last post
Johannes
Offline
Joined: 11/17/2016 - 06:42
Adressing functions dynamically

Hi Brian,
your website has been really succesfull in helping me out with several IDEA issues. Thank you so much. However, I didn't find so far a solution to call functions dynamically (Call functions with the names: Function1, Function2, Function3 ...). Therefore I wanted to ask, whether you know a function (similar to VBA Excel's Eval) for sth like this (see also file):
Dim CurrentFunction as String
For Counter=1 to 5
CurrentFunction= "Function" & Counter
Call Eval(CurrentFunction)
Next Counter
This is just a general example, as I want to apply this to most of my scripts. Thank you in advance.
Regards
Johannes
 

Files: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Johannes,

I am glad you are finding the site useful :-).  Unfortunately IDEAscript does not allow you to do what you want (at least I have never been able to figure it out).  I would also enjoy having something like this which exists in other languages but to the best of my knowledge you can not do this in IDEAScript.  All the function names have to be hard coded and you can't access them through variable names.

Sorry.

Brian

Johannes
Offline
Joined: 11/17/2016 - 06:42

Hello Brian,
Thank you for your quick response. Then I have to write it out fully. :)
Regards
Johannes