Moin,
I have something like
FuncKind := "A"
if (FuncKind == "A")
MyFunc := FuncA
if (FuncKind == "B")
MyFunc := FuncB
MyFunc
This works fine.
Is it possible to write something like
MyFunc := "Func" . FuncKind
I tried to understand the docs "Func Object" and "Function Objects" but cannot figure out how to manage my task.
Is it possible and if so how?
Thx in advance. HugoM
Create dynamic function Topic is solved
Re: Create dynamic function
MyFunc := Func%FuncKind%
Re: Create dynamic function
There is nothing about this that is specific to functions. This is not creating a function, dynamic or otherwise. You are just picking between multiple variables based on the name of the variable. thqby's suggestion will work regardless of whether FuncA and FuncB refer to functions or to other types of values (but for the latter, there is less reason to use individual dynamic variables; an array or map should probably be used instead).
Re: Create dynamic function
So easy!
Thank You and all the best
Thank You and all the best