Defined for procedures, useful for OOP

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Defined for procedures, useful for OOP

Post by Justin »

let's see if i can explain. i have an object that fires events, those events are stored as pointers to functions and they are called only if there is a pointer. the pointers are filled using put_myevent(@myevent())

if i could do something like

Code: Select all

Macro app_namespace
 app
endmacro

Macro app_fillevents(appobject)
CompilerIf Defined(app_namespace#myevent, #PB_Procedure) 
  appobject\myevent = @app_namespace#myevent()
CompilerEndIf
endmacro
this way declaring a procedure starting with the namespace and the event name would be called as an event. similar like vbs i think

Code: Select all

procedure appmyevent()
endprocedure