Handlers not found in card script

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: FourthWorld, heatherlaine, Klaus, kevinmiller

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Handlers not found in card script

Post by Simon » Fri Feb 06, 2015 1:29 am

I think it's time for a quick trick
On Win it's;
Ctrl+Shift+c
Will show you the card script of the currently showing card
Ctrl+Shift+s
Will show you the stack script
Mac has similar

I only point this out as there has been confusion over where scripts are (card or stack). It does tell you at the top of the script editor where the script you are editing is, but it's a bit convoluted.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Handlers not found in card script

Post by dave.kilroy » Fri Feb 06, 2015 2:01 am

Good point Simon! Another thing to watch out for is whether you have two cards with the same name (open the Project Browser from the 'Tools' menu to check)...
"...this is not the code you are looking for..."

xoolonite
Posts: 11
Joined: Thu Jan 15, 2015 6:25 pm

Re: Handlers not found in card script

Post by xoolonite » Fri Feb 06, 2015 11:38 am

dave.kilroy wrote:Aha! Good we are getting somewhere...

If handlers are not appearing on the left then I think there is a bug in the card's script which is preventing it from compiling

Probably the best way to find the bug is to comment out all the handlers except one and hit compile - if the one un-commented handler now appears in the left you know that the script compiled and that the bug is not in that particular handler. Next uncomment another handler, compile, check in the left - and continue until you get all the handlers in the left disappearing again (which means you've hit the bug). Once you get this you will know the bug is in that handler. After you've identified the buggy handler carry out a similar commenting/uncommenting process to find the source of the problem

Good luck! It shouldn't take you more than a few minutes to sort out - if you get stuck then upload the stack here...

Dave
Hi Dave,

Have tried to add handlers from scratch and only able to add one handler to the card script at any onetime. It doesn't matter what its called. How do I upload the stack? This seems to a bug with my system : Mac late 2007 running Yosemite 10.10 and the latest livecode 7.0.2 (rc2). Have spent a long time trying to get this to work.. thks Martin

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Handlers not found in card script

Post by dave.kilroy » Fri Feb 06, 2015 11:59 am

Hi Martin - shame this isn't working for you yet...

If you can't see an 'upload files' tab like in the screenshot when you are in the 'post a reply' screen I think you must be below the minimum number of postings before you're allowed to upload files:
Screen Shot 2015-02-06 at 10.51.57.png
If you don't see the tab then do you have Dropbox? If so do a 'share Dropbox link' thingie and insert the link here - or send me the stack via pm and I'll upload it here for you...

Dave
"...this is not the code you are looking for..."

xoolonite
Posts: 11
Joined: Thu Jan 15, 2015 6:25 pm

Re: Handlers not found in card script

Post by xoolonite » Fri Feb 06, 2015 12:11 pm

get this message when loading attachment??

The extension livecode is not allowed.
This is really frustrating... will set up dropbox for you now if you can supply email address...

xoolonite
Posts: 11
Joined: Thu Jan 15, 2015 6:25 pm

Re: Handlers not found in card script

Post by xoolonite » Fri Feb 06, 2015 12:44 pm

dave.kilroy wrote:Hi Martin - shame this isn't working for you yet...

If you can't see an 'upload files' tab like in the screenshot when you are in the 'post a reply' screen I think you must be below the minimum number of postings before you're allowed to upload files:
Screen Shot 2015-02-06 at 10.51.57.png
If you don't see the tab then do you have Dropbox? If so do a 'share Dropbox link' thingie and insert the link here - or send me the stack via pm and I'll upload it here for you...

Dave
Here's the dropbox link: https://www.dropbox.com/sh/2qfji8fckhbk ... gAkda?dl=0

Hope this helps.

Martin

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Handlers not found in card script

Post by SparkOut » Fri Feb 06, 2015 12:46 pm

Zip the file first, then you will be able to upload it here

xoolonite
Posts: 11
Joined: Thu Jan 15, 2015 6:25 pm

Re: Handlers not found in card script

Post by xoolonite » Fri Feb 06, 2015 12:52 pm

Zipped file uploaded.
Attachments
Calculator.zip
(1.94 KiB) Downloaded 229 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Handlers not found in card script

Post by Klaus » Fri Feb 06, 2015 1:43 pm

Just tested the stack. Does not work in LC 7.0.2 (handler not found!), but does work in LC 6.7.x (handler found)!? The SAME stack?
Oh boy... :(

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Handlers not found in card script

Post by anmldr » Fri Feb 06, 2015 2:37 pm

------------
Last edited by anmldr on Fri Feb 06, 2015 3:55 pm, edited 1 time in total.

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Handlers not found in card script

Post by anmldr » Fri Feb 06, 2015 2:38 pm

------------
Last edited by anmldr on Fri Feb 06, 2015 3:56 pm, edited 1 time in total.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Handlers not found in card script

Post by dave.kilroy » Fri Feb 06, 2015 3:25 pm

Hi all - there was some invisible character(s) in the declaration of the operatorPressed handler that was causing the failure. The following is one way to get things working again:

1 - copy the 'innards' of the operatorPressed handler
2 - delete the complete handler
3 - apply and save the code (you should now see the numberPressed handler appearing in the left hand side)
4 - declare the operatorPressed handler again (you need to type this afresh, do not try to copy the declaration from the old handler)
5 - paste the 'innards' from the old handler in the new version of operatorPressed
6 - remember to add the pOperator parameter to the declaration
7 - apply and save the code (you should now see all handlers in the left hand pane)

Kind regards

Dave
"...this is not the code you are looking for..."

xoolonite
Posts: 11
Joined: Thu Jan 15, 2015 6:25 pm

Re: Handlers not found in card script

Post by xoolonite » Fri Feb 06, 2015 4:03 pm

Problem solved with a lot of help from Dave; there were unspecified hidden character(s) present in the operatorPressed handler including the comments causing it to fail.
See Dave Kilroy breakdown for process followed to correct the problem.
Thanks for all contributions

Martin

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Handlers not found in card script

Post by dave.kilroy » Fri Feb 06, 2015 4:15 pm

Martin this was a tricky bug to spot - especially for someone new to the LiveCode IDE - perhaps the two takeaways should be:

1 - if you are really stuck ask at the forum
2 - if handlers don't appear in the left pane, stop and find out why - even if the script compiles!

Kind regards

Dave
"...this is not the code you are looking for..."

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Handlers not found in card script

Post by dave.kilroy » Fri Feb 06, 2015 4:23 pm

Klaus I'm wondering whether the different ways the stack is handled in the script editors of LC 6.7 and 7.0 be something to do with the fact that LC 7 allows unicode in scripts?
Klaus wrote:Just tested the stack. Does not work in LC 7.0.2 (handler not found!), but does work in LC 6.7.x (handler found)!? The SAME stack?
Oh boy... :(
If so, then this should be considered a bug as it is not 'fair' that invisible entities can lurk in scripts that break the scripts but don't throw an error.

Martin how do you feel about filing your first bug report?

Dave
"...this is not the code you are looking for..."

Post Reply