PDA

View Full Version : Idea for TBEM (or other modules) and thinCore



ErosOlmi
23-03-2008, 08:04
Hi Mike.
This post is just auto-brainstormig so sorry if it seems too sparse and not focused.

Before leaving for my days off I was thinking about the way TBEM fires events or in general how thinBasic modules interact with thinBasic Core engine.
I was thinking about some sort of "set it and forget" or a way for the module creator to install kind of personalized function inside thinBasic Core to be executed automatically by thinBasic engine. Like many applications install their own functions in the Window message queue we can think a way to installa a module function in the main loop of thinBasic engine and thinBasic, automatically, call all the installed injected function.

How to use this idea?
For example creating some events once, than install a TBEM module (or other modules) function into thinBasic engine and thinBasic will call this function continuosly during script parsing. If this special module function has something to do, it can do. Otherwise just exit and control will return to thinBasic engine.
In the case of TBEM, this function can be the internal function that executes all the installed events without the need to have inside the script main loop the list of triggers or events to be called.

I'm still focusing in my mind if this is a good idea or not because this kind of injection can have important positive and/or backdoors to thinBasic engine.
Anyhow, something to think if I'm boring in next two days.

Ciao
Eros

Michael Hartlef
23-03-2008, 10:55
That sounds like an interesting solution. I want to hear more about it. TBEM_Run could be a canidate for it. As it has a parameter, we would have to find a way how to deal with this.