Jump to content
DeathF0X

String to function name

Recommended Posts

Hey, is there a way to convert/escape the string into a function name ?

So its logs a string error.

 

Example:



["myFunction",["a","b"] ] call example;

example = {

_fnc = _this select 0;
_params = _this select 1;

_params call _fnc;

};

Share this post


Link to post
Share on other sites

_params call call compile _fnc;

 

Yes, it must be a double call, because the first call is to get the function from what the compile creates and the second is to actually call the function.

 

You could also do

 

_params call (missionNamespace getVariable _fnc);

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×