How does a command find out who called it?
m.schonewille at economy-x-talk.com
Wed Feb 1 10:49:10 CST 2012
You could use a different callback message for each control or include the id of the target in the data sent to the server and make the server return the id together with other data. I think that using a different callback for control is the easiest approach.
Economy-x-Talk Consulting and Software Engineering
Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za
On 1 feb 2012, at 17:28, Ken Corey wrote:
> On 01/02/2012 16:04, Mark Schonewille wrote:
>> send "someCallback" to the target in 0 millisecs
> Thanks, Mark, but I need the call from the other direction...
> Let's say I have a card "testing" in stack "wild".
> The stack script says:
> on openCard
> start using "minihttp.livecode"
> end openCard
> The card script says:
> on someHandler ...
> httpGet "http://blah.com","myCallback"
> end someHandler
> on myCallback ...
> -- do someting brilliant with the data we've requested
> end myCallback
> Finally, I have a stack called "minihttp.livecode".
> The stack script looks like:
> on httpGet pUrl,pCallback
> -- save the callback
> put pCallback into gMCB
> -- kick off asynchronous httpGet operations with a local callback
> mysocketOpen "address","mySocketCallback"
> -- now return
> end httpGet
> on mySocketCallback args
> -- Yay! Finally have the data. Hand it back
> send gMCB to XXX in 0 milliseconds
> end mySocketCallback
> The question is: How do I know what "XXX" is in the mySocketCallback?
> If there were a way in httpGet to say:
> put the name of my caller into gDataTarget
> Then in mySocketCallback I could just say:
> send gMCB to gDataTarget in 0 milliseconds
> See what I'm going for here? Is there a way to get this information in Livecode?
More information about the use-livecode