Case Study: Behaviors Failing - Can't set break points

Todd Geist todd at geistinteractive.com
Tue Dec 27 16:19:51 CST 2011


On Tue, Dec 27, 2011 at 1:59 PM, Richard Gaskin
<ambassador at fourthworld.com>wrote:
>
> If you find the script is in play under such circumstances, I'd like to
> learn how you did it.
>
> I've been wanting a way to resolve behaviors at arbitrary execution points
> rather than relying on stack opening, and have made this request for a new
> "resolve behaviors" command to do that:
> <http://quality.runrev.com/**show_bug.cgi?id=8993<http://quality.runrev.com/show_bug.cgi?id=8993>
> >
>

Well I am not sure if I have what you are looking for. But I can tell you
that I have behaviors in a sort of half linked state.  They do not work BUT
in the IDE if you control click on a such button with a broken behavior and
select "Send Message" you will see the Handlers in the Behavior script.  If
you try to to send the message, it fails.

My Behaviors are on the second card of a Library Stack. That was loaded
into memory using "start using". It was not opened before the "start
using".  These Behaviors are loaded AFTER the stack that uses them. And it
is this stack that has the broken behaviors.  This makes sense since I am
loading the behaviors too late.  But the behaviors are in memory they are
just not correctly linked to their child buttons any more.

in my case I can fix these quite easily because all the broken buttons are
on one card. I am using them for code only.  I simply loop through the
controls on the card and set the behavior of each control to itself.

*On* ResetBeahviors

   *repeat* with i = 1 to the number of controls of me

      *put* the long id of control i of me into tControl

      *put* word 1 of the name of tControl into tType

      *if* tType = "button" *then*

         *set* the behavior of tControl to the behavior of tControl

      *end* *if*

   *end* *repeat*

*end* ResetBeahviors


Hope that helps

Todd


More information about the use-livecode mailing list