I used to use function handles extensively until lite-C. I have tried every way possible and have read every piece of documentation and still can't resolve my issue. The handle function appears to give me the SAME value regardless of what function or action I give it. Here is an example of what I am trying to do:
action pAction();//pointer to an action
action myAction() { beep(); }
var hMyAction = handle(myAction);//This will return the SAME value regardless of what function or action it receives.
pAction = ptr_for_handle(myAction);
pAction();//Crashes here and I believe it's because of the handle
Chaos is a paradox consistently inconsistent.
Re: handle function may not be working properly
[Re: i_program_games]
#156586 09/24/0711:2709/24/0711:27
Ok, so I've done this and it crashes on my PC but not my laptop.
//prototype function test_function();
#define TEST_FUNCTION 0 function pFunction(); //function pointer function* pFunctions[1]; //array of function pointers
pFunctions[TEST_FUNCTION] = test_function; //assign function pointer to array
function test_function() { beep(); }
function test_event() { pFunction = pFunctions[my.skill50]; //get our stored pointer index via skill variable pFunction(); //CRASHES HERE ON MY PC BUT NOT THE LAPTOP }