Event messaging system for B3D?

Blitz3D Forums/Blitz3D Programming/Event messaging system for B3D?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Could be useful. You might use:
a) a type for events (field event$, for example)
b) a type for active events (also, field event$)
c) a type for event registrations (field event$, field callback ??? - see below)
d) a function to fire off an event (would create a new object of the active_event type)
e) a function allowing an object to register as a listener for an event (create a new object of the event_registration type)
f) an event manager, called in the main loop, that detects all events (loops "for each" on the active_event type), calls all event handlers registered for each active event and then deletes that event from the active_events queue.

The trouble seems to be the callbacks - does Blitz allow passing the name or address of a function as a parameter, storing it in a field of an "event_registration" type, and calling that function to pass the notification of an event to a registered object?

There's my two bits on theory. I don't know if Blitz allows passing a function as a parameter, or supports callbacks.