function pointeur in a array !

Just starting out? Need help? Post your questions and find answers here.
minirop
User
User
Posts: 24
Joined: Tue Nov 28, 2006 12:21 am

function pointeur in a array !

Post by minirop »

hello,
I want to know if it's possible to create an array or a linked list of pointeur to a function.
example :
dim Array.***(50)
Array(0) = @Beep_()
...
Array(0)() would be the same as Beep_()

somebody knows ?

thx
++
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

You mean this?

Code: Select all

If OpenLibrary(0,"kernel32.dll")
 *BeepFuncPointer = GetFunction(0,"Beep")
EndIf

Debug *BeepFuncPointer

Structure Pointer
 MyFuncPointer.l
EndStructure

Dim Array.Pointer(50)
Array(0)\MyFuncPointer = *BeepFuncPointer

CallFunctionFast(Array(0)\MyFuncPointer,500,500)
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

....or look at Prototype...
oh... and have a nice day.
minirop
User
User
Posts: 24
Joined: Tue Nov 28, 2006 12:21 am

Post by minirop »

thx !
I never remember that array(0)\f() is possible
;)
++
Post Reply