Skip to content
⌘ NSIS Forum Archive

Can I call functions dynamically?

4 posts

WindBridges#

Can I call functions dynamically?

I have some strings stored in variables. For example, let $0 = "Foo" and $1 = "Bar". I have two functions that have to be called - MyFuncFoo and MyFuncBar. I have to call these functions by enumerating variables - something like Call "MyFunc$0" and then Call "MyFunc$1". I need such behavior because order of variable's values may vary, and some values may be skipped, so order of function calls will vary too. I know it's not possible to specify function name as string in Call, but may be I can emulate this behavior somehow? or any other way to do that?
WindBridges#
But how can it help if parameter for GetFunctionAddress must be static compile-time string not containing any variables?
Anders#
The other alternative is a function with just a big switch and it would have to know all the names of the functions...