View Single Post
Re: Storing an array of function calls, and their params.....
Old
  (#6)
Maleficus
Member
 
Maleficus's Avatar
 
Status: Offline
Posts: 1,054
Join Date: May 2004
Location: Planet Earth
Default Re: Storing an array of function calls, and their params..... - 16-05-2005

I did a quick test last night, and it seemed to work just fine the way you described it Lazy.

I kept everything in the scruct the same, but I added two ints that hold the parameters, and instead of doing this:

Code:
callerFunc->fooFunc = MyCoolFunc(44, 22);
I do this:

Code:
callerFunc->fooFunc = MyCoolFunc;
Which compiles fine without errors. Then, when I want to exec the function that occupies that array spot, I do this:

Code:
callerFunc->fooFunc(callerFunc->param1, callerFunc->param2);
And at least for the quick test that I did, it ran perfectly, doing exactly what I wanted it to do.

Thanks again for the help!


Dum Spiro Spero



Last edited by Maleficus; 16-05-2005 at 22:16..
  
Reply With Quote