Message Path Question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Message Path Question
OK so here is the deal. I uncompressed the zipped sttack and launched it and it worked fine. Thought Hmmm... Went into the card script and wrote another short handler of messed up code and tried the button again. Same error message. closed out the stack and re opened it. Again same error message. Closed the live code application and reloaded it. IT WORKED FINE ! Edited another line of bad code in a card script handler. same error message.
So as long as I close out live code after every syntax error I make and relaunch livecode it I should be fine. BLaaaa!!!!
Can you guys just for grins re open the stack and try and write a bad line of code and then hit the cool button again. I'm just trying to figure out if its my system or what. Thanks a ton for helping. I owe you.
Dave
So as long as I close out live code after every syntax error I make and relaunch livecode it I should be fine. BLaaaa!!!!
Can you guys just for grins re open the stack and try and write a bad line of code and then hit the cool button again. I'm just trying to figure out if its my system or what. Thanks a ton for helping. I owe you.
Dave
Re: Message Path Question
Further digging,
As a matter of fact I don't even need to type a bad line of code. Just opening the stack script and typing a letter and then erasing the same letter disables the message path between the good button scripts and the good card script handlers until I close live code out and re-open it.
In other words as soon as I edit the card script in any way as long as I have a bad line of code somewhere in that card script all the other good calls to the card script can't find their good handlers.
Dave
As a matter of fact I don't even need to type a bad line of code. Just opening the stack script and typing a letter and then erasing the same letter disables the message path between the good button scripts and the good card script handlers until I close live code out and re-open it.
In other words as soon as I edit the card script in any way as long as I have a bad line of code somewhere in that card script all the other good calls to the card script can't find their good handlers.
Dave
Re: Message Path Question
You *are* compiling after editing, right?
Re: Message Path Question
Compiling after editing. Not sure what that means? I do have the debugger checked in the development menu.
The error message that pops up is not for the bad line of code in the card script. It doesn't pop up with the card script showing at all, it pops the button script up that is headed to a perfectly good handler in the card script saying it can't find the handler.
When I close out live code and reopen it the button works fine until I click in the card script window. . If I save and close the stack and then reopen the stack it is still broke. If I close rev the stack works again. You get it.
The error message that pops up is not for the bad line of code in the card script. It doesn't pop up with the card script showing at all, it pops the button script up that is headed to a perfectly good handler in the card script saying it can't find the handler.
When I close out live code and reopen it the button works fine until I click in the card script window. . If I save and close the stack and then reopen the stack it is still broke. If I close rev the stack works again. You get it.
Re: Message Path Question
You're clicking the "Apply" button after editing?Compiling after editing. Not sure what that means?
Re: Message Path Question
Yes I always do hit the apply button.
Re: Message Path Question
I just downloaded the test stack to my windows machine running Livecode 4.6.3 and the test stack works fine as some of you reported. You can throw in as many syntax errors as you want in the card script and it doesnt affect the ability of the properly coded buttons from finding their properly coded handlers in the card script and executing them.
I loaded 4.6.3 IOS and Anroid version on my Mac running lion and have the same issues with the message path from the card to the card script being interupted.
If anyone has any sugestions I am all ears.
Dave
I loaded 4.6.3 IOS and Anroid version on my Mac running lion and have the same issues with the message path from the card to the card script being interupted.
If anyone has any sugestions I am all ears.
Dave
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Message Path Question
They worked fine for me too. Here are a couple of other simple demo stacks you might try. The first one just prints the card, button and stack name in the field by passing the mouse up message up the message path (the button gets it and prints its name, then the card gets it and prints its name, finally the stack gets it and prints its name). It just tests the message path. The second one tests navigating from one card to the next using forward and backward buttons. You can also add new cards with the new button. You might want to give these a try to see if you get similar error messages or if they work correctly. If you get the same problems I would suspect something outside LC, maybe Lion?FireWorx wrote:Thats messed up ! When I open the stack and click the "do Something Cool" button the debug window pops up with message
button "Do Something Cool": execution error at line 2 (Handler: can't find handler) near "dosomethingcool", char 1
When I click the button "Do Something even cooler" I get the error message.
button "Do Something even cooler": execution error at line 2 (Handler: can't find handler) near "dosomethingevencooler", char 1
The exact same stack. I have reloaded 4.6.4 three times and have no plugins. I have located it in the application folder the first time and in the Documents folder the second time. There is no other code in this stack other than what is presented.
Now what?
-- Mark
- Attachments
-
- Navigation Example 2.livecode.zip
- (1.29 KiB) Downloaded 295 times
-
- Message Path Example.livecode.zip
- (684 Bytes) Downloaded 303 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Message Path Question
Hi Mark,
I tested your stacks.
They work fine for me (LC 463)
OSX 10.4.2 powerbook G4
OSX 10.5.8 imac intel duo Core
OSX 10.6.8 Macbook pro
Best regards
Jean-Marc
I tested your stacks.
They work fine for me (LC 463)
OSX 10.4.2 powerbook G4
OSX 10.5.8 imac intel duo Core
OSX 10.6.8 Macbook pro
Best regards
Jean-Marc
https://alternatic.ch
Re: Message Path Question
Hi Mark,
What's happen if you replace "last cd" with cd &&the num of cds like this :
Best
Jean-Marc
What's happen if you replace "last cd" with cd &&the num of cds like this :
Code: Select all
on preopencard
## When we go to a card check with buttons should be enabled
put the num of cds into tNbCards
if the number of this card is 1 then
disable button "back" of this card
else
enable button "back" of this card
end if
if the number of this card = tNbCards then
disable button "next" of this card
else
enable button "next" of this card
end if
end preopencard
Jean-Marc
https://alternatic.ch
Re: Message Path Question
Dave,
Ran your stack on Win7 x64 LC 4.6.4, ran fine. Turned on Strict Compilation, and of course it didn't like the "do somethingmessedup", as expected, since there is no handler by that name. Turned off Strict Compilation, recompiled, worked fine. Added junk code to "dosomethingcool", compiled fine, got the debugger when I clicked the button. Fixed it, compiled again, ran fine. Changed the name of the "dosomethingcool" handler to "dosomethingcoo", got the appropriate error (couldn't find handler), fixed it, ran fine.
It sounds like it's acting after an error like LC is not clearing some temporary list of errored handlers, tokens, some error flag, or some breakpoint metadata that it should be. I don't know the internals well, or Lion, like where LC might be storing temporary results or breakPoint metadata, if there's some kind of issue there - like the code writing the errors has different perms than the code clearing them?
I hope some LC lurker here who knows the internals might be able to pipe in. I tried getting info out of the LC code itself but lunched my installation of course
and had to reinstall (no big deal, I run default installs) - I'm not up to digging in there more...
Ran your stack on Win7 x64 LC 4.6.4, ran fine. Turned on Strict Compilation, and of course it didn't like the "do somethingmessedup", as expected, since there is no handler by that name. Turned off Strict Compilation, recompiled, worked fine. Added junk code to "dosomethingcool", compiled fine, got the debugger when I clicked the button. Fixed it, compiled again, ran fine. Changed the name of the "dosomethingcool" handler to "dosomethingcoo", got the appropriate error (couldn't find handler), fixed it, ran fine.
It sounds like it's acting after an error like LC is not clearing some temporary list of errored handlers, tokens, some error flag, or some breakpoint metadata that it should be. I don't know the internals well, or Lion, like where LC might be storing temporary results or breakPoint metadata, if there's some kind of issue there - like the code writing the errors has different perms than the code clearing them?
I hope some LC lurker here who knows the internals might be able to pipe in. I tried getting info out of the LC code itself but lunched my installation of course

Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Message Path Question
I just looked at your sample stack and there are no syntax errors in it. "Do" is a legitimate keyword, so the "messedup" handler won't error on compile, the engine will think it is just fine. It will error during execution though, with "can't find handler" because there is no handler named "somethingmessup". But since neither of your buttons ever call a handler named "unCoolMessingMeUP", that particular handler never runs.
The engine will ignore the "bad" handler because it is never called, and syntactically it is correct.
You say it works for you until you try to edit the script in some way. Editing a script will cause a recompile, and if you have entered any syntax errors, then no compile will happen. The entire script will be missing in action until the error is fixed and the script can be compiled correctly.
To repeat your experience, we'd need to know what you entered into the script editor.
The engine will ignore the "bad" handler because it is never called, and syntactically it is correct.
You say it works for you until you try to edit the script in some way. Editing a script will cause a recompile, and if you have entered any syntax errors, then no compile will happen. The entire script will be missing in action until the error is fixed and the script can be compiled correctly.
To repeat your experience, we'd need to know what you entered into the script editor.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Message Path Question
Good point and even more reason that I shouldn't be getting this error message.
button "Do Something Cool": execution error at line 2 (Handler: can't find handler) near "dosomethingcool", char 1
button "Do Something even cooler": execution error at line 2 (Handler: can't find handler) near "dosomethingevencooler", char 1
My point is that on your machine the stack worked fine and the cool button calls found there handlers. On my machine they don't.
I understand the process a lot better now, I reloading 4.6.3 and things are better. I guess if i don't get the "apply button to pop up in the left corner of the script box that my script has an error in it? Because if I don't see the apply button and I save and close the script box no error will alert me, and when I click on the button nothing will happen, and if I set a breakpoint nothing will happen, and if I run any other good button script on the card that has a good handler I will get an error regarding that handler. But I can always copy and past the button over and over to fix the syntax errors soI have that as a work around.
Dave
button "Do Something Cool": execution error at line 2 (Handler: can't find handler) near "dosomethingcool", char 1
button "Do Something even cooler": execution error at line 2 (Handler: can't find handler) near "dosomethingevencooler", char 1
My point is that on your machine the stack worked fine and the cool button calls found there handlers. On my machine they don't.
I understand the process a lot better now, I reloading 4.6.3 and things are better. I guess if i don't get the "apply button to pop up in the left corner of the script box that my script has an error in it? Because if I don't see the apply button and I save and close the script box no error will alert me, and when I click on the button nothing will happen, and if I set a breakpoint nothing will happen, and if I run any other good button script on the card that has a good handler I will get an error regarding that handler. But I can always copy and past the button over and over to fix the syntax errors soI have that as a work around.
Dave
Re: Message Path Question
PS To answer your question all I had to do was bring focus to the card script by typing a letter in the card script box and then erasing it. That was enough to spoil the cool button handlers.
And to clarify my answer "I always hit the apply button" Often times the apply button is not there to click. So I click on the box in the far left corner to close the script box out and then hit save in the next box that pops up.
Thanks again,
Dave
And to clarify my answer "I always hit the apply button" Often times the apply button is not there to click. So I click on the box in the far left corner to close the script box out and then hit save in the next box that pops up.
Thanks again,
Dave
Re: Message Path Question
If the Apply button is dimmed, it means the script has already been saved and there is nothing new to apply. Type anything into the script editor and the Apply button will become enabled because the script has changed. It will then show you any errors the next time you click it.
If the Apply button is not visible at all, but instead is replaced by a row of debugging icons, then you are in debugging mode and you can't work with the script at all until you cancel out of that. You exit debugging mode by clicking the blue square icon in the row at the top left, or by choosing "Stop" from the Debug menu, or by typing Command-Y.
I don't recommend forcing the editor out of debugging mode by closing its window. Better to exit using one of the other ways. I'm not sure what will happen to the script if you shut it down that way during debugging. Maybe the problem is related to how you're exiting out of debugging mode.
If the Apply button is not visible at all, but instead is replaced by a row of debugging icons, then you are in debugging mode and you can't work with the script at all until you cancel out of that. You exit debugging mode by clicking the blue square icon in the row at the top left, or by choosing "Stop" from the Debug menu, or by typing Command-Y.
I don't recommend forcing the editor out of debugging mode by closing its window. Better to exit using one of the other ways. I'm not sure what will happen to the script if you shut it down that way during debugging. Maybe the problem is related to how you're exiting out of debugging mode.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com