Missing message

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Missing message

Post by snm » Mon Jul 02, 2012 6:47 pm

I have the stack with one card, and wanted to use "on preOpenCard" handler to clear fields content. But it didn't work at all - when I opened the stack, the fields content was still exist.

To check it I added second card and navigation buttons. Then I saw in the Message Watcher, that going from first card to the second there is preOpenCard message sent, but going back to the first card there is not preOpenCard in the Message Watcher.

What can be the reason, that preOpenCard message is not sent to this card?

Marek

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Missing message

Post by jmburnod » Mon Jul 02, 2012 7:21 pm

Hi Marek,

Where is the preopencard script ?

Jean-Marc
https://alternatic.ch

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message

Post by snm » Mon Jul 02, 2012 10:02 pm

Handler is in 1-st card script.

Marek

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Missing message

Post by townsend » Mon Jul 02, 2012 10:49 pm

If you don't need that second card, delete that, with the Tools | Application Browser.
What you're describing should work. Maybe you can post your clear statements.
Maybe there's some syntax error in there. Or--- just put all your clear statements
in a button to see if they work at all. You're doing a put empty into field "some.name"
Make sure you put the reference "field" in there or LC will think you're referring
to local variables.

Put a Beep or Answer statement in the preopencard handler.
Is it being fired? How about the opencard handler?

Also, with a right click on the stack area, you should see an option,
Send Card Message. Use that to simulate a stack opening,
so you don't have to keep closing and opening your app.

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message

Post by snm » Mon Jul 02, 2012 11:15 pm

Hi townsend,

The second card is for testing only. As I mentioned before there is no preOpenCard message sent when you go from 2-nd card to 1-st card, so the handler is not executed - you can't see this message in LC Message Watcher. If the message is not sent - the script in handler is not executed doesn't matter how the script is builded and what should do.

Said simpler: no preOpenCard message sent - no execution of "on preOpenCard" handler.

My question was what can be the reason of missing preOpenCard message before opening the card. I have not any problems with script used in the handler. It's simple put empty into fld "Field"', no way to make mistake.

When you go from card 1 to card 2, preOpenCard message is visible in LC Message Watcher in the sequence of messages.

Marek

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Missing message

Post by jacque » Mon Jul 02, 2012 11:21 pm

The behavior sounds like you accidentally put the handler into the script of the second card. Double-check. Any card that has a preOpenCard handler will execute it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message

Post by snm » Mon Jul 02, 2012 11:31 pm

I know that already. Going to first card doesn't send preOpenCard message. Going to second card sends this message. I know it seems to be strange behavior. Message Watcher (the tool from LC Developer menu) shows any messages sent, but not preOpenCard when going to this one card. Going to any other card shows preOpenCard message there, and triggers preOpenCard handler script properly (even the same copied script).

Marek

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Missing message

Post by jacque » Mon Jul 02, 2012 11:41 pm

Are messages ever locked?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message

Post by snm » Tue Jul 03, 2012 6:20 am

Never by me and other(maybe not all) messages are sent and working. I have DG on this card, and it's set up with DGH - maybe there is the reason, but I can't find how to check it. I also made menu with Menu Builder there, but without puting any scripts there yet.

Marek

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Missing message

Post by jacque » Tue Jul 03, 2012 6:39 pm

Set a breakpoint in one of the handlers somewhere before you change cards and then step through the scripts using "step into" line by line. That should give you a hint where things are going off track. Something is blocking the message from being sent and stepping through the code can sometimes give you an idea where it happens.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message

Post by snm » Tue Jul 03, 2012 9:43 pm

When I'm opening the stack, the first handler which should be triggered is preOpenCard, but it doesn't because message is not sent. There is not any script run before open the card. No way to set any breakpoint before the handler. I set break as the first line of preOpenCard handler script. And nothing - script didn't start because the message was not sent.

I builded the stack from the beginning with new objects, copied all scripts from the wrong stack - everything is working as expected. It's the proof there is not bug in any script. Still no idea why preOpenCard is not sent in old stack.

Marek.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Missing message

Post by jacque » Tue Jul 03, 2012 9:56 pm

I'm curious to see your broken stack. If you don't mind me looking, send a zipped copy to the email in my signature. Maybe I can tell what happened.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Missing message - solved

Post by snm » Fri Jul 06, 2012 1:43 pm

Thanks to Jacque the problem is solved. He found in my stack, that there is geometry preferences set in custom property pane of faulty working card.

How to solve such problem if somebody experience it:
- check "LiveCode UI Elements in Lists" from menu "View"
- in "Card Property Inspector" choose "Custom Properties" pane
- select "Geometry property" set and trash it

Thanks a lot Jacque.

Marek

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Missing message

Post by jacque » Fri Jul 06, 2012 8:14 pm

Just to clarify a little more: there were geometry manager settings on the card, which are stored by LiveCode as a property set. Something in those settings was apparently causing a problem or was in conflict with the LC geometry scripts, which run when a card opens. The scripts were aborting due to the error and no further engine messages were sent.

Deleting the custom property set removes the geometry from the card so LiveCode won't try to run any geometry scripts. It solves the problem with the error. Geometry needs to be set up again, since the instructions are now missing. If the same geometry is used the problem may recur, but I'm thinking it was due to an inadvertent conflict that would be hard to repeat.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply