How do you set up a function pointer then, just to be sure, how do you call the function using the pointer.
And you can do this to a function inside a type as well right?
And you can do this to a function inside a type as well right?
Type TmyType Field Action(Sender:TmyType) Field X:Int Field Y:Int Function Create:TmyType(X:Int, Y:Int, Action(Sender:TmyType)) Local tempType : TmyType = New TmyType tempType.X = X tempType.Y = Y tempType.Action = Action Return tempType End Function End Type Global t:TmyType = TmyType.Create(10, 20, Draw)'note the lack of brackets after Draw Function Draw(Sender:TmyType) DrawRect(Sender.X, Sender.X, 100, 100) End Function Graphics 640,480,0,0 While Not KeyDown(KEY_ESCAPE) Cls t.Action(t) Flip Wend End
Function Agru2( X, Y) Function Agru1(X ) Function Agru0() Func()[3] Func[0] = Agru0 Func[1] = Agru1 Func[2] = Agru2 func[0] func[1](1) func[2](1,2)