"on opencard" handler

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm
Location: Albuquerque, NM USA

"on opencard" handler

Post by churchken » Tue Oct 11, 2011 9:03 pm

Hi,

This one has me stumped.

A stack's "on opencard" handler works fine in dev environment, but fails to execute in stand alone version.

I've deleted the handler, rebuilt it, tried totally different code in a handler by that name -- all work fine while in livecode, but fail after stand alone is built. This is specific to this stack, as "on opencard" still works in stand alone versions of other stacks created after this problem started.

Anyone seen this type of behavior before?

Thanks.
Ken

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

Re: "on opencard" handler

Post by SparkOut » Wed Oct 12, 2011 7:51 am

Hi Ken
My first thought is to check the handler for oddness in the script, it definitely seems to be only affecting this one handler, so that is the place to begin your investigation. Therefore some lines of script code would be helpful.
My first guess is maybe you have a handler looking up folder paths?? In the IDE the relative path is from the location of the engine, while in a standalone it is from the location of the standalone executable. If so, you may need to adjust the location where the handler is looking by getting a relative folder path by parsing "the effective filename of this stack".
Otherwise... I guess seeing some script is the only idea I have at the moment.

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm
Location: Albuquerque, NM USA

Re: "on opencard" handler

Post by churchken » Wed Oct 12, 2011 1:37 pm

Hi, Sparkout,

Thanks for your reply. The script code "inside" the "on opencard" handler does not change the situation. Deleting the entire code, then using:

on opencard
put "This time it worked" & CR into fld"testlog"
end opencard

also fails to place the text in that field. It's like there is something corrupted in the livecode that causes any "opencard" handler to fail.

As a last resort, I will rebuild the stack code from scratch, but that is not a pleasant alternative.

Thanks.
Ken

Klaus
Posts: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: "on opencard" handler

Post by Klaus » Wed Oct 12, 2011 2:59 pm

Hi Ken,

it is also worth a try to only re-build that card!
Delete it and create a new one, should work 8)


Best

Klaus

AndyP
Posts: 616
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: "on opencard" handler

Post by AndyP » Wed Oct 12, 2011 4:45 pm

What happens if you use

preOpenCard

instead of

openCard ?

Also you say at the begining of your post 'A stack's "on opencard"..' Just to check you're putting the openCard in the cards script and not the stacks?
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7266
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: "on opencard" handler

Post by jacque » Wed Oct 12, 2011 5:38 pm

The most likely reason is that you have an opencard handler in the card that is blocking execution of the opencard handler in the stack. Also check group and background scripts, because those can block too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: "on opencard" handler

Post by mwieder » Wed Oct 12, 2011 5:47 pm

Yes, but that doesn't necessarily explain why it works in the IDE and not in a standalone. That part's puzzling.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7266
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: "on opencard" handler

Post by jacque » Wed Oct 12, 2011 6:26 pm

Oh right, forgot about that part. I guess we'd need to see an example stack.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: "on opencard" handler

Post by mwieder » Wed Oct 12, 2011 6:49 pm

That would be useful. Ken?

I do notice that there's no space between fld and "testlog" in your typed example. I assume it's right in the actual stack. And that there's a "testlog" field available for the text.

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm
Location: Albuquerque, NM USA

Re: "on opencard" handler

Post by churchken » Thu Oct 13, 2011 1:03 pm

Thanks to everyone for the helpful ideas.

In the end, I did "rebuild" the card from the most recent backup copy of the livecode which still worked correctly. Not too much downtime connected with it.


MWieder -- gosh, I've never used a space after the FLD and it's always worked OK for the field update.

Again, thanks to all the generous folks here. The "Revolution" community is first rate!

Regards,
Ken

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: "on opencard" handler

Post by mwieder » Thu Oct 13, 2011 6:19 pm

MWieder -- gosh, I've never used a space after the FLD and it's always worked OK for the field update.
<g> I've never *not* used a space... I guess it's good to know it works both ways.

Glad you got it working.

Post Reply

Return to “Talking LiveCode”