I can use the address-of operator (@) to acquire the address of a procedure - but how can I then CALL this procedure, using the stored address?
example:
Code: Select all
; Callback
Procedure CallMe(Value.l)
Debug("Called with the value "+Str(Value))
EndProcedure
Structure MyStruct
MyProc.l ; this will hold the address of a procedure
EndStructure
DefType.MyStruct Test
Test\MyProc = @CallMe()
; ... now what?
this is a dumb example, because I could obviously just call the CallMe procedure instead of storing it's address first, but the point is, I'm in a situation where Test\MyProc could hold the address of a number of different procedures, all with the same parameters.
I could write a dispatch procedure of course, but that isn't possible in the project I'm working on, since it's an include that I want to reuse, and the application using the include must be able to "register" it's own procedures, which will be called by the include...
