Handler won't run

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
bd525
Posts: 21
Joined: Sun Aug 31, 2014 12:43 am

Handler won't run

Post by bd525 » Fri Mar 25, 2016 5:49 am

In the "on mouseUp" handler of a button I have a line that consists of the name of another handler. The handler by that name is in the script of the card on which the button resides. The handler in the card script is properly named and formatted. It starts with "on handlerName" and ends with "end handlerName". When I run the stack and click the button I get an error message that includes "(Handler: can't find handler)". I am a beginner, but I believe I understand the message path. A handler call from a button would go immediately to the card script; right?

I assume this simple question may be answered somewhere on the forum, but I cannot search for a string such as "can't find handler". The forum search function only searches for individual words, so when I search "can't find handler" (in the quotes) I get a list of all 6,000 or so posts that include the word "handler" and I don't relish searching all of those. Why is that? Seems like such a simple need; to search for a text string that includes more than one word, yet it appears that cannot be done.

Any assistance is appreciated. Thanks!

Bruce

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6162
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Handler won't run

Post by dunbarx » Fri Mar 25, 2016 6:29 am

Hi.

Does the handler in the card script fire from the message box?

Otherwise, something is amiss. If you have in a button:

Code: Select all

on mouseUp
doThis
end mouseUp
And in the cards script:

Code: Select all

on doThis
answer "Bingo"
end doThis
It ought to give you a dialog. Sure of your spelling? Try another handler call right above the one that throws the error, (make sure to put the handler in the card script)

Does that one fire? We will fix this, never fear. I bet 50 ticks it will engender one of those :oops: emoticons.

Craig Newman

bd525
Posts: 21
Joined: Sun Aug 31, 2014 12:43 am

Re: Handler won't run

Post by bd525 » Fri Mar 25, 2016 2:30 pm

The problem was that I didn't know about the Apply button in script windows. I'm migrating from Director, which shows script errors automatically. Another handler in the card script prior to the handler in question had a missing "then" in an "else" keyword line. I noticed the Apply button, clicked it, and the error showed. Fixing that error fixed my problem.

Thanks for the quick reply, Craig! It's reassuring to know that the forum is monitored well, and that assistance comes in timely fashion.

So, I suppose yes, a qualified :oops:

Bruce

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6162
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Handler won't run

Post by dunbarx » Fri Mar 25, 2016 3:08 pm

Ah.

The script editor will in certain instances show an error before it is compiled (before applying). I am not sure how egregious these might need to be, and they occur only in certain constructions.

Anyway, you owe me 50 ticks.

Craig

bd525
Posts: 21
Joined: Sun Aug 31, 2014 12:43 am

Re: Handler won't run

Post by bd525 » Fri Mar 25, 2016 3:26 pm

Put it on my credit card.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”