What is wrong with this script?

J. Landman Gay jacque at hyperactivesw.com
Thu Nov 4 21:23:30 EDT 2010


On 11/4/10 7:55 PM, charles61 wrote:

> When I of marked card y, the script that looks like the following
> caused the printing to hang and I had to force quit Rev 4.0 and
> relaunch Rev.

This, plus the recursion error you got, likely indicates that your 
scripts are going in circles without a way to complete. What does your 
"mouseUp" handler do exactly? If it calls a different handler, which in 
turn calls the mouseUp again, then your script will loop between the two 
handlers until eventually you get the error, or it looks like you hung. 
(Did you try command-period to stop the scripts?)

Usually it's better not to call system messages if possible. Instead of 
sending a mouseup to a button, send a custom handler name instead. Then 
have your mouseUp handler call that same custom handler. For example, if 
you have this:

on mouseUp
   commandOne
   commandTwo
end mouseUp

Instead, do this:

on mouseUp
  doStuff
end mouseUp

on doStuff
   commandOne
   commandTwo
end doStuff

Now your looping reset script can send "doStuff" to each button instead 
of sending "mouseUp" to it. In fact, all your handlers that need to do 
the mouseUp button stuff should be sending "doStuff" instead.


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list