Opening a version 8 stack in LiveCode 9

A place to discuss Version Control in LiveCode

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

minboden
Posts: 4
Joined: Fri Aug 28, 2020 8:55 pm

Opening a version 8 stack in LiveCode 9

Post by minboden » Fri Aug 28, 2020 9:08 pm

Hello,

I have a stack that was created in Livecode 8 and I would like to upgrade to LiveCode 9. However when I open the stack in lc 9, the preOpenStack and openStack handlers do not fire (not even if I put a test button on the screen and tell it to run either of these handlers). I created a test stack in lc 9 with these handlers and it worked there. Has any one else had this problem? Any help would be appreciated!

Thank you

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Opening a version 8 stack in LiveCode 9

Post by bangkok » Sat Aug 29, 2020 12:14 am

Very strange. And never experienced that !

You need to follow a process :
-give us details about your OS, which LC version do you use (9) and the same for your "old" LC (8)

-try to reproduce the problem with a sample stack that you can send us after so people can have a look

-and/or fill in directly a bug report on https://quality.livecode.com

minboden
Posts: 4
Joined: Fri Aug 28, 2020 8:55 pm

Re: Opening a version 8 stack in LiveCode 9

Post by minboden » Sat Aug 29, 2020 1:20 am

I am using Windows 10 64bit running LiveCode (9_6_1) Indy. The stack was created in LiveCode 8_1_10

I have made a copy of my stack and stripped it of everything but a button and two fields.
The stack script reads:

Code: Select all

on preopenstack
put "preopenstack worked" into fld 1
end preopenstack


on openstack
put "openstack worked" into fld 2
end openstack
The button script reads:

Code: Select all

on mouseup
preopenstack
end mouseup
When opening the stack neither preopenstack or openstack fire.

When I compile the stack into a standalone it works! How do I send you my stack? -- Sorry, I am very new to this forum:)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Opening a version 8 stack in LiveCode 9

Post by richmond62 » Sat Aug 29, 2020 8:47 am

Well, if you are new to this forum there is some sort of waiting period until you can post attachments,
so the best thing is, probably, to ZIP your stack and put it on a Dropbox account, a Google-Drive or
somewhere else like that and then post a download link here.
Last edited by richmond62 on Sat Aug 29, 2020 10:12 am, edited 1 time in total.

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

Re: Opening a version 8 stack in LiveCode 9

Post by Klaus » Sat Aug 29, 2020 10:04 am

Hi minboden,

welcome to the forum!
Due to high spamming you need to have at least seven posting before you can post attachments, links etc.
richmond62 wrote:
Sat Aug 29, 2020 8:47 am
WEll, if you are new to this forum there is some sort of waiting period until you can post attachments,
so the best thing is, probably, to ZIP your stack and put it on a Dropbox account, a Google-Drive or
somewhere else like that and then post a download link here.
Richmond, I think that's called "Catch 22"! See above. :-D


Best

Klaus

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

Re: Opening a version 8 stack in LiveCode 9

Post by jacque » Sat Aug 29, 2020 7:06 pm

The link could be altered to comply. We've seen enough of that to understand:
www (dot) domain (dot) com/ page (dot) html
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: Opening a version 8 stack in LiveCode 9

Post by mwieder » Sun Aug 30, 2020 4:50 am

Technically the openstack and preopenstack handlers should be in the script of the first card in the stack, but I can't see that making a difference here.
You've got a very strange problem. Looking forward to your being able to post the stack here for forensics.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Opening a version 8 stack in LiveCode 9

Post by richmond62 » Sun Aug 30, 2020 9:00 am

Technically the openstack and preopenstack handlers should be in the script of the first card in the stack
That might just explain why, for years, I've had problems when I've put these in the stackScript.

The inevitable dirty question pops up, unbidden:

What is the stackScript for?

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Opening a version 8 stack in LiveCode 9

Post by bangkok » Sun Aug 30, 2020 10:12 am

richmond62 wrote:
Sun Aug 30, 2020 9:00 am
Technically the openstack and preopenstack handlers should be in the script of the first card in the stack
That might just explain why, for years, I've had problems when I've put these in the stackScript.
That's what i love with such a forum ! Even as an"old timer" it's possible to learn something.... striking ! :D

Why openstack and preopenstack should be on the first card script ?

Like you, I always put this kind of stuff within the stack script.

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

Re: Opening a version 8 stack in LiveCode 9

Post by SparkOut » Sun Aug 30, 2020 12:28 pm

It's the way the message path works. Such messages will go to the first card, and it doesn't matter whether it's a stack message, if it has a handler in the card script, it will be trapped there (unless passed). If no handler is in the card script, or passed, it will continue up to the stack.

The single biggest reason for putting a preOpenstack or openStack message in the card script is that in that case it will only be relevant to the stack in question. If you have a substack without a preOpenstack or openStack handler of its own, then when it opens it will fail to handle the message and then pass it to the mainstack script, and will trigger the mainstack handler, which is likely not appropriate.
Obviously closeStack and other stack messages apply - so even more relevant for a substack not to trigger a cleanup handler that closes and quits the mainstack, say.

I'm sure jacque or Richard would be able to explain much more succinctly,.

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

Re: Opening a version 8 stack in LiveCode 9

Post by jacque » Sun Aug 30, 2020 5:31 pm

You explained it perfectly, SparkOut.

I put handlers in the stack script that need to be accessed from anywhere in the stack. Generally these are custom handlers but not always. They include things like utility handlers, navigation handlers, server communication, and other generic handlers that can act on any card. A non-custom handler like scrollerDidScroll is in the stack script of my current project so it can respond to any mobile scroller anywhere. If I need a standard action for all cards it goes in the stack script; for example, closecard to delete all mobile controls before changing cards.
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: Opening a version 8 stack in LiveCode 9

Post by mwieder » Sun Aug 30, 2020 6:37 pm

The preOpenStack and openStack messages first go to the card, and then if there's no handler there to catch them, pass on to the stack.
So in many cases it won't matter whether you put the handlers in the card script or the stack script.

But if you have substacks then each substack will also invoke the preOpenStack/openStack handlers if you have them in the script of the mainstack.
For that reason I isolate the handlers into the card scripts to keep things clean.
The alternative is to put dummy handlers into the substack scripts to prevent triggering the mainstack handlers again.

minboden
Posts: 4
Joined: Fri Aug 28, 2020 8:55 pm

Re: Opening a version 8 stack in LiveCode 9

Post by minboden » Mon Aug 31, 2020 6:47 pm

Thank you for a the input every one has given. I put my stack up on onedrive. Here is the share link for it.

https://1drv(dot)ms/u/s!AhxknZXHwUWjpWRiQTnE8TB3KCkd?e=kAG9eL

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: Opening a version 8 stack in LiveCode 9

Post by mwieder » Mon Aug 31, 2020 8:52 pm

Wow! That's one seriously messed-up stack.
You have a watched variable set on the stack itself

Code: Select all

Watches
   228660,mouseUp,tstacks
Watchstates
  Active
That causes an "object not found" error in the preOpenStack handler.
If you remove the watched variable information from the stack the handlers fire normally.
(using the Inspector, look at the cREVGeneral custom property set)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Opening a version 8 stack in LiveCode 9

Post by FourthWorld » Mon Aug 31, 2020 11:52 pm

Well done, Mark. That stack mystified me. I would never have thought of LC's message watcher stuff as a potential issue. The more ya' know...
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Version Control”