[HELP] how to trigger a callback from an external...

Andre Garzia andre at andregarzia.com
Fri Feb 13 16:40:17 EST 2009


Hello Friends,

another question about externals. If I have a function that register a
callback for later use upon some event. How do I send a message from
the external to the engine? I saw the SendCardMessage() call but this
will send the message to this card of this stack and that might not be
the place I want to send the message to.

Any of the external writing gurus out there could shed a clue?

The idea is simple, the developer will use a command to register a
callback for an event, upon the event happening, I want that message
to be triggered. So far I could not find a way to do that nor a way to
capture the context or scope or wherever-the-engine-was when the
register message was called so that I could send the triggered event
to the same place.

I could call EvalExpr() from inside the register callback routine to
pick the value of the long id of me and thus have a fixed point to
send my message back and then using the same EvalExpr() call, assemble
a carefully piece of transcript to send the message back there, but
this appears to be a little hackish. (well, I am fond of hacking
anyway)...

cheers

Andre

-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list