Handlers not found in card script
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Handlers not found in card script
Error message:
executing at 10:57:32 AM
Type Handler: can't find handler
Object group id 1030
Line numberPressed the short name of the target
Hint numberPressed
Have checked all scripts and unable to determine problem. Spelling correct and new handler added to card script. Have the latest version of Livecode and no errors shown when script applied. Following tutorial as far as I know accurately, the new handlers not showing in code window dropdown.
Any clues?
Martin
executing at 10:57:32 AM
Type Handler: can't find handler
Object group id 1030
Line numberPressed the short name of the target
Hint numberPressed
Have checked all scripts and unable to determine problem. Spelling correct and new handler added to card script. Have the latest version of Livecode and no errors shown when script applied. Following tutorial as far as I know accurately, the new handlers not showing in code window dropdown.
Any clues?
Martin
Re: Handlers not found in card script
Hi Martin,
1. welcome to the forum!
2. "numberPressed" is not a build-in Livecode command or function!
Did you create a handler or function with this name in the card script?
If not, what exactly do you want to do?
Please provide more info, maybe post the complete script(s) and an explanation about the "layout" of your objects, thanks.
To learn more about the basics of Livecode, I recommend to check these great stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
1. welcome to the forum!
2. "numberPressed" is not a build-in Livecode command or function!
Did you create a handler or function with this name in the card script?
If not, what exactly do you want to do?
Please provide more info, maybe post the complete script(s) and an explanation about the "layout" of your objects, thanks.
To learn more about the basics of Livecode, I recommend to check these great stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Handlers not found in card script
Hi Klaus,
This is in the Livecode Course for building the Calculator app. Here is the card script: In the window I don't see the added handler option. I have tried assiging the handler to the group for the number objects in the calculator. Does this make sense?
local lCurrentOperator
local lCurrentOperator
on operatorPressed pOperator
if lCurrentOperator is not empty then
set the showborder of button lCurrentOperator to false
end if
--Set the border color to Black
set the borderColor of button pOperator to black
set the showBorder of button pOperator to true
put pOperator into lCurrentOperator
end operatorPressed
on numberPressed pNumPress
put pNumPress after field "display"
end numberPressed
on percentPressed
put field "display" into tCurrentValue
put tcurrentvalue / 100 into field "display"
end percentPressed
This is in the Livecode Course for building the Calculator app. Here is the card script: In the window I don't see the added handler option. I have tried assiging the handler to the group for the number objects in the calculator. Does this make sense?
local lCurrentOperator
local lCurrentOperator
on operatorPressed pOperator
if lCurrentOperator is not empty then
set the showborder of button lCurrentOperator to false
end if
--Set the border color to Black
set the borderColor of button pOperator to black
set the showBorder of button pOperator to true
put pOperator into lCurrentOperator
end operatorPressed
on numberPressed pNumPress
put pNumPress after field "display"
end numberPressed
on percentPressed
put field "display" into tCurrentValue
put tcurrentvalue / 100 into field "display"
end percentPressed
Re: Handlers not found in card script
Hi Martin,
hm, if this is in the card script then all object scripts on this card should be able to access it!?
Sorry, no brilliant idea in the moment...
Does it work if you create a new button on the card with:
?
Best
Klaus
hm, if this is in the card script then all object scripts on this card should be able to access it!?
Sorry, no brilliant idea in the moment...
Does it work if you create a new button on the card with:
Code: Select all
on mouseup
numberPressed the short name of me
end mosueup
Best
Klaus
Re: Handlers not found in card script
if I interchange "number" with "operator" its works as expected on the same card??
on mouseUp
operatorPressed the short name of me
end mouseUp
on mouseUp
numberPressed the short name of me
end mouseUp
on mouseUp
operatorPressed the short name of me
end mouseUp
on mouseUp
numberPressed the short name of me
end mouseUp
Re: Handlers not found in card script
Hm, SHOULD work!
Sorry, no idea...
Sorry, no idea...
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Handlers not found in card script
Hi Martin - does numberPressed appear in the left-hand pane of the script editor like this?
"...this is not the code you are looking for..."
Re: Handlers not found in card script
Martin--
You can in fact get great help in this forum. However, you should look for the "Create it With LiveCode" forum where most of us have/are posting. If you don't have access--it is one of the private forums--then check with RunRev about gaining access.
Hope to see you there.
Linda
You can in fact get great help in this forum. However, you should look for the "Create it With LiveCode" forum where most of us have/are posting. If you don't have access--it is one of the private forums--then check with RunRev about gaining access.
Hope to see you there.
Linda
Re: Handlers not found in card script
Hi Dave,
The handlers are not showing in the left hand list and I have tried to find out why! When adding to card script they are not saving??
Is there an edit mode that needs switching on?
Thks
Martin
The handlers are not showing in the left hand list and I have tried to find out why! When adding to card script they are not saving??
Is there an edit mode that needs switching on?
Thks
Martin
Re: Handlers not found in card script
anmldr wrote:Martin--have found this now and will post in future to the private forum.
Thks Linda.
You can in fact get great help in this forum. However, you should look for the "Create it With LiveCode" forum where most of us have/are posting. If you don't have access--it is one of the private forums--then check with RunRev about gaining access.
Hope to see you there.
Linda
Re: Handlers not found in card script
Hi Dave,dave.kilroy wrote:Hi Martin - does numberPressed appear in the left-hand pane of the script editor like this?
The handlers are not showing in the left hand list and I have tried to find out why! When adding to card script they are not saving??
Is there an edit mode that needs switching on?
Thks
Martin
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Handlers not found in card script
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
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
"...this is not the code you are looking for..."
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Handlers not found in card script
BTW I should think that the original error message you were getting (that it couldn't find the handler in the card script) was the engine complaining that there was no matching handler in the script because the card script hadn't compiled)
The error message could be more informative I agree - but no handlers/functions appearing in the left pane is a clear indication that something is wrong
The error message could be more informative I agree - but no handlers/functions appearing in the left pane is a clear indication that something is wrong
"...this is not the code you are looking for..."
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Handlers not found in card script
Hi Martin, just noticed your question:
The answer is no, nothing special to turn on - try creating a new card or open the script of any object and create a new hander (call it something like "mytesthandler" and once you hit compile the handler name should appear on the leftxoolonite wrote:The handlers are not showing in the left hand list and I have tried to find out why! When adding to card script they are not saving??
Is there an edit mode that needs switching on?
"...this is not the code you are looking for..."
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: Handlers not found in card script
Should have said - the fact you can't get handlers to appear on the left in your card script is a sign that something is wrong with that script - try commenting out everything in the script and see if you can create the 'mytesthandler' I mention before. If you script still won't co-operate then upload your stack to see if another person's eyes can see what is going on
Kind regards
Dave
Kind regards
Dave
"...this is not the code you are looking for..."