How does a command find out who called it?

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Feb 1 11:04:13 EST 2012


Hi Ken,

Use this syntax:

send "someCallback" to the target in 0 millisecs

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za

On 1 feb 2012, at 16:42, Ken Corey wrote:

> I have some tiny http utility functions I'm using to do a 'get' on an iOS device.
> 
> Up to now, I've had these functions in the same card as the handlers dealing with that card.  Now I want to make them into a library.
> 
> The problem I'm hvaing is that they are asynchronous: they require a callback.
> 
> Up to now, it was in the same card, so I didn't have to specify it.
> 
> Unfortunately, now that the functions are in a separate stack being used as a library, I need to know the name of the calling card, so I can know the context in which to do the callback.
> 
> Right now my httpGet looks like this:
> 
> httpGet "http://blah.com/testing.html?a=1&b=2","myCallback"
> 
> The code returns immediately, and when the answer comes back, nyCallback is called with the result.
> 
> However, my library dies because there's no callback with the given name in it.  It's in the original calling card.
> 
> I'd rather not change the API if I could get away with it...
> 
> Anyone know how to find out who called a given command?
> 
> -Ken





More information about the use-livecode mailing list