Opening a version 8 stack in LiveCode 9
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Opening a version 8 stack in LiveCode 9
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
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
Re: Opening a version 8 stack in LiveCode 9
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
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
Re: Opening a version 8 stack in LiveCode 9
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:
The button script reads:
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:)
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
Code: Select all
on mouseup
preopenstack
end mouseup
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:)
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a version 8 stack in LiveCode 9
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.
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.
Re: Opening a version 8 stack in LiveCode 9
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.
Best
Klaus
welcome to the forum!
Due to high spamming you need to have at least seven posting before you can post attachments, links etc.
Richmond, I think that's called "Catch 22"! See above.richmond62 wrote: ↑Sat Aug 29, 2020 8:47 amWEll, 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.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Opening a version 8 stack in LiveCode 9
The link could be altered to comply. We've seen enough of that to understand:
www (dot) domain (dot) com/ page (dot) html
www (dot) domain (dot) com/ page (dot) html
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- 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
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.
You've got a very strange problem. Looking forward to your being able to post the stack here for forensics.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Opening a version 8 stack in LiveCode 9
That might just explain why, for years, I've had problems when I've put these in the stackScript.Technically the openstack and preopenstack handlers should be in the script of the first card in the stack
The inevitable dirty question pops up, unbidden:
What is the stackScript for?
Re: Opening a version 8 stack in LiveCode 9
That's what i love with such a forum ! Even as an"old timer" it's possible to learn something.... striking !richmond62 wrote: ↑Sun Aug 30, 2020 9:00 amThat might just explain why, for years, I've had problems when I've put these in the stackScript.Technically the openstack and preopenstack handlers should be in the script of the first card in the stack
Why openstack and preopenstack should be on the first card script ?
Like you, I always put this kind of stuff within the stack script.
Re: Opening a version 8 stack in LiveCode 9
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,.
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,.
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Opening a version 8 stack in LiveCode 9
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.
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
HyperActive Software | http://www.hyperactivesw.com
-
- 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
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.
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Opening a version 8 stack in LiveCode 9
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
https://1drv(dot)ms/u/s!AhxknZXHwUWjpWRiQTnE8TB3KCkd?e=kAG9eL
-
- 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
Wow! That's one seriously messed-up stack.
You have a watched variable set on the stack itself
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)
You have a watched variable set on the stack itself
Code: Select all
Watches
228660,mouseUp,tstacks
Watchstates
Active
If you remove the watched variable information from the stack the handlers fire normally.
(using the Inspector, look at the cREVGeneral custom property set)
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Opening a version 8 stack in LiveCode 9
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn