LC 4.6.3 Gotcha?

Bob Sneidar bobs at twft.com
Mon Aug 29 12:32:52 EDT 2011


This stack references the stack the originally calling button is on. I don't know why things changed it should have always worked that way. You could put a handler in the target stack script like so:

on answerMe
   answer the short name of this stack
end answerMe

dispatch answerMe to stack foo
send "answerMe" to stack foo in 0 seconds

Because the script that actually calls the function belongs to the target stack, it will reference the target stack. 

dispatch "answer the short name of this stack" to stack foo

will reference the calling stack, not the target stack, because the script calling it belongs to the calling stack. 

Bob


On Aug 27, 2011, at 12:16 PM, Timothy Miller wrote:

> It's me, the OP. Apparently, no one knows the answer to my question.
> 
> So, I'll ask an easier one:
> 
> Hypothetically, we have a stack which includes a button.
> 
> the script of the button:
> 
> On mouseup
> 	do this
> 	do that
> 	go to stack "schedule"
> 	answer the short name of this stack
> 	fooHandler
> end mouseUp
> 
> The answer command confirms that we have arrived at stack "schedule"
> 
> on stack "schedule" there is a group, with a script:
> 
> on fooHandler
> 	answer "the foo has been handled"
> end fooHandler
> 
> Is the syntax correct?
> 
> Or, am I supposed to write:
> 
> Send "fooHandler" to stack "schedule" 
> 
> or something of that nature?
> 
> Depending on the answer, I might have a followup question.
> 
> 
> Tim
> 
> 
> On Aug 26, 2011, at 10:39 PM, Timothy Miller wrote:
> 
>> My previous message with this subject line was too complicated and hard to understand, so I'm going to re-post it, simplified:
>> 
>> A script that has worked for years has stopped working. I'm not getting an error message. It just partly executes, then stops.
>> 
>> The only reason I can think of is that I recently upgraded from LC 4.5.x to LC 4.6.3 (for the Macintosh).
>> 
>> The essence of the old script:
>> 
>> go to stack "schedule"
>> billingnote2
>> 
>> the "billingnote2" message is supposed to find its handler in the script of a group on stack "schedule" I'm sure the necessary group is present on the card.
>> 
>> As a test, I put this handler in the group script of stack "schedule"
>> 
>> on billingNote2
>> 	answer "this handler is working"
>> end billingNote2
>> 
>> I'm not getting an answer.
>> 
>> I changed the script:
>> go to stack "schedule"
>> send "billingnote2" to stack "schedule"
>> 
>> it started working.
>> 
>> Why did this script stop working? Does it have something to do with the upgrade to 4.6.3?
>> 
>> Cheers,
>> 
>> 
>> Tim
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list