Function Pointers
BlitzMax Forums/BlitzMax Beginners Area/Function Pointers
| ||
Hi all, I've been trying to figure out function pointers. I found this example posted about 7 months ago, but it doesn't work for me. Specifically, I get the following error: "Expression of type 'Byte Ptr' cannot be invoked" for the line l[0]. Would anyone mind explaining what I'm doing wrong? SuperStrict Local l:Byte Ptr[5] l[0]=test1 l[1]=test2 l[0] Function test1() Print"1" EndFunction Function test2() Print"2" EndFunction |
| ||
An int array could do the job as wellSuperStrict Local l:Int()[] l[0]=test1 l[1]=test2 l[0]() Function test1() Print"1" EndFunction Function test2() Print"2" EndFunction |
| ||
Ah, that makes it very clear. Thanks a lot! |