ID:845827
 
Keywords: calling, function, list
(See the best response by DarkCampainger.)
Let's think about this. I have a list, each item of a list haves a function. Look example:

var
x = list("myFunction1" = myFunction1());

proc/myFunction1() {
world << "x";
}


Works fine, but the, how do i call the "myFunction1" (The one in the list) so it prints the "x"

Best response
You're not creating a "function pointer", you're just setting "MyFunction1" to the value returned by myFunction1(). If you want to dynamically call a function, you need to use the call() process.
teststuff/var
Functions = list();

var
teststuff/teststuff;


client/New()
..();
var/teststuff/test/a = new();
call(a.Functions[1])();

teststuff/test
New()
world << "I've been created!"
Functions = list("test" = /teststuff/test/proc/test);
call(Functions[1])();

proc/test()
world << "Test"


test() doesn't get called. :/
You want the second format: call(Object,ProcName)(Arguments). That way you can specify the source object.

Also, Functions[1] is equal to the text string "test", not your function path.