Fixed Yet? Three Questions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Fixed Yet? Three Questions
I've got questions about 3 long-standing issues I've had with LiveCode. Specifically, I want to know if these things have been "fixed" over the past decade or so. In some cases these may not be actual bugs, so "fixed" may not be correct. Let's just say I've got 3 questions, all about the way my app saves data.
[Background Info You Probably Should Skip] My app is my now 20-year-old (started in HyperCard) Classroom Quizshow, which I wrote during my first year as a fourth-grade teacher. It's a primative program, really, but it does exactly what I want, and it's my baby. Links for my app (not trying to advertise--though I should since my sales rate is somewhere south of 1/month ): http://www.classroomquizshow.com, https://itunes.apple.com/us/app/classro ... d444523515
Question 1 of 3: Have the file writing/saving/copying routines in LiveCode been "fixed"? I ask this because I've been using Unix commands instead because of this forum post: http://runtime-revolution.278305.n4.nab ... 98309.html (see first reply to this post).
Question 2 of 3: It seems I have to close my data stacks after each use. Otherwise I get an error that they're already open when I try to use them later. Is this true? Is this best practice? Does this have to do with the whole destroyStack thing, and if so, how? I admit to being unclear on destroyStack's ramifications. My understanding is destroyStack, if true, removes the stack from memory when the stack is closed, but again, I don't understand the importance of this or how it affects this error I get when trying to re-access an open stack. That was more than one question, but they're all pretty much the same one.
Question 3 of 3: So I've been closing my data stacks after every use, but I found I can't use Close Stack because it takes its sweet time getting the stack closing done. Instead I have to use Delete Stack. This bothers me because although I know Delete Stack actually closes the stack and doesn't delete it (it only deletes a stack if it's a substack), this seems rather hinky to me. It seems like if I want to close a stack, I shouldn't be using the scary word "delete". I'm also suspicious that my use of Delete Stack might be a reason I'm getting Mac App Store rejections for my latest update. (Though I've been using Delete Stack for a long time, Apple's requirements change frequently.) So my actual question #3 is: Does Close Stack work correctly (immediately) now, or should I continue using Delete Stack?
Thank you for any help you can give to one or more of these three questions.
Steve
[Background Info You Probably Should Skip] My app is my now 20-year-old (started in HyperCard) Classroom Quizshow, which I wrote during my first year as a fourth-grade teacher. It's a primative program, really, but it does exactly what I want, and it's my baby. Links for my app (not trying to advertise--though I should since my sales rate is somewhere south of 1/month ): http://www.classroomquizshow.com, https://itunes.apple.com/us/app/classro ... d444523515
Question 1 of 3: Have the file writing/saving/copying routines in LiveCode been "fixed"? I ask this because I've been using Unix commands instead because of this forum post: http://runtime-revolution.278305.n4.nab ... 98309.html (see first reply to this post).
Question 2 of 3: It seems I have to close my data stacks after each use. Otherwise I get an error that they're already open when I try to use them later. Is this true? Is this best practice? Does this have to do with the whole destroyStack thing, and if so, how? I admit to being unclear on destroyStack's ramifications. My understanding is destroyStack, if true, removes the stack from memory when the stack is closed, but again, I don't understand the importance of this or how it affects this error I get when trying to re-access an open stack. That was more than one question, but they're all pretty much the same one.
Question 3 of 3: So I've been closing my data stacks after every use, but I found I can't use Close Stack because it takes its sweet time getting the stack closing done. Instead I have to use Delete Stack. This bothers me because although I know Delete Stack actually closes the stack and doesn't delete it (it only deletes a stack if it's a substack), this seems rather hinky to me. It seems like if I want to close a stack, I shouldn't be using the scary word "delete". I'm also suspicious that my use of Delete Stack might be a reason I'm getting Mac App Store rejections for my latest update. (Though I've been using Delete Stack for a long time, Apple's requirements change frequently.) So my actual question #3 is: Does Close Stack work correctly (immediately) now, or should I continue using Delete Stack?
Thank you for any help you can give to one or more of these three questions.
Steve
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Fixed Yet? Three Questions
A stack's destroystack property determines whether it gets purged when its window is closed. Set that to true and #2 and #3 go away.
As for revFileCopy, I rarely use it myself (I tend to prefer the built-in read/write, using shell calls only for things not already built-in), that thread you linked to was 10 years ago. A lot's happened since then. Maybe worth trying in whatever script you'd had that wasn't working?
As for revFileCopy, I rarely use it myself (I tend to prefer the built-in read/write, using shell calls only for things not already built-in), that thread you linked to was 10 years ago. A lot's happened since then. Maybe worth trying in whatever script you'd had that wasn't working?
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
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: Fixed Yet? Three Questions
Thanks, FourthWorld. I think I understand what you're saying about destroyStack. Let me restate at least one question still unanswered, though:
Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
Thanks,
Steve
P.S. I never have success searching this forum because all the relevant words are deleted from my search due to their being too common. Really, it renders the search tool useless. Is it just me?
Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
Thanks,
Steve
P.S. I never have success searching this forum because all the relevant words are deleted from my search due to their being too common. Really, it renders the search tool useless. Is it just me?
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Fixed Yet? Three Questions
Not if you first set the stack's destroyStack property.stephenmcnutt wrote:Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
I submitted a request for a purge command, but I wouldn't expect that right away. The simplest solution is to just set the destroyStack once and then you never have to think about it ever again.
I'm not a big fan of PHPBB's default settings either, nor the cumbersome means they provide to change them. Do you mind if I ask what terms you were searching for? Next time I poke around I'll see if I can lighten things up a bit with PHPBB's restrictions.P.S. I never have success searching this forum because all the relevant words are deleted from my search due to their being too common. Really, it renders the search tool useless. Is it just me?
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
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Fixed Yet? Three Questions
Hi stephenmcnutt,
"my query" site:http://forums.runrev.com/
Simon
Use google;P.S. I never have success searching this forum because all the relevant words are deleted from my search due to their being too common. Really, it renders the search tool useless.
"my query" site:http://forums.runrev.com/
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Fixed Yet? Three Questions
Hi Simon,
Kind regards
Bernd
maybe rather use google:Use google;
"my query" site:http://forums.runrev.com/
Code: Select all
"mySerarch" site:http://forums.livecode.com/
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Fixed Yet? Three Questions
Hi Bernd,
I thought I changed that a year ago!
Thanks,
Simon
I thought I changed that a year ago!
Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: Fixed Yet? Three Questions
I don't think that's exactly true, FourthWorld. I'm pretty sure I HAVE had destroyStack set to true for all my data stacks all along, but I find "close stack" doesn't really close the stack immediately, and I get errors later when I try to open the stack again only to find it's still open. That's why I went to "delete stack", but I don't like using it because it seems to me "close stack" should do just that, and "delete stack" should do just that. Still, if this is the way these two commands still function, I'll use them as needed.FourthWorld wrote:Not if you first set the stack's destroyStack property.stephenmcnutt wrote:Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
Maybe I should re-ask a question from my original post at this point: Can I just leave the data stacks open (but invisible) the whole time my standalone app is running, or is that a bad idea? If I remember correctly, doing this gave me "can't open stack with same name" or some such errors when I tried using the already-open stacks later. That's how I started wanting to close the stacks after every use.
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: Fixed Yet? Three Questions
One example is searching for "delete stack", with or without the quotes. The search says it ignores "stack" because it's too common, but then the results returned with just "delete" are about other delete issues I'm not interested in. For some reason, it does find posts I myself have made containing both words.FourthWorld wrote:I'm not a big fan of PHPBB's default settings either, nor the cumbersome means they provide to change them. Do you mind if I ask what terms you were searching for? Next time I poke around I'll see if I can lighten things up a bit with PHPBB's restrictions.
I'll try the Google suggestion. Thanks.
Re: Fixed Yet? Three Questions
Hi, Steve.Maybe I should re-ask a question from my original post at this point: Can I just leave the data stacks open (but invisible) the whole time my standalone app is running, or is that a bad idea? If I remember correctly, doing this gave me "can't open stack with same name" or some such errors when I tried using the already-open stacks later. That's how I started wanting to close the stacks after every use.
I also produce classroom games with Livecode. Here are a few pointers drawn from my experience.
* I set the destroyStack to true on every stack.
* I make stacks invisible instead of closing (removing them from memory) them, unless they are user data files, which I close. (IIRC, substacks of the main stack always stay in memory, so closing them is the same as just hiding them.)
* I simplify by only supporting one user file open at a time. (No one has complained about that in 16 years.)
Are your users creating and naming their data files? Are these the files causing you problems? Or is the problem with your own Preference and internal Data files?
One way you can avoid "can't open stack with same name" is to check the StacksInUse list and see if your stack is already open. If so, just show it (or start using it).
Hope some of that helps.
Tom Bodine
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Fixed Yet? Three Questions
The gods must has heard you, as I just tested both forms (with quotes and without) and both were accepted and delivered meaningful results.stephenmcnutt wrote:One example is searching for "delete stack", with or without the quotes. The search says it ignores "stack" because it's too common, but then the results returned with just "delete" are about other delete issues I'm not interested in. For some reason, it does find posts I myself have made containing both words.FourthWorld wrote:I'm not a big fan of PHPBB's default settings either, nor the cumbersome means they provide to change them. Do you mind if I ask what terms you were searching for? Next time I poke around I'll see if I can lighten things up a bit with PHPBB's restrictions.
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
-
- VIP Livecode Opensource Backer
- Posts: 9840
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Fixed Yet? Three Questions
Were there perhaps substacks of those stacks that were still open? LC treats all contents of a stack file as a single in-memory entity, similar to how it's stored on disk. So to completely a remove a stack from memory you'd need to have the destroyStack property set for all stacks in the file, and then close all of them.stephenmcnutt wrote:I don't think that's exactly true, FourthWorld. I'm pretty sure I HAVE had destroyStack set to true for all my data stacks all along, but I find "close stack" doesn't really close the stack immediately, and I get errors later when I try to open the stack again only to find it's still open. That's why I went to "delete stack", but I don't like using it because it seems to me "close stack" should do just that, and "delete stack" should do just that. Still, if this is the way these two commands still function, I'll use them as needed.FourthWorld wrote:Not if you first set the stack's destroyStack property.stephenmcnutt wrote:Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
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
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Fixed Yet? Three Questions
Re: searching the forum...
No, you're not alone in that, and that's the main reason I don't spend much time here.
The listserv archives are much easier to search through, especially on gmane and nabble.
No, you're not alone in that, and that's the main reason I don't spend much time here.
The listserv archives are much easier to search through, especially on gmane and nabble.
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: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Fixed Yet? Three Questions
Closing a stack that has its deleteStack property set to true will always close it and remove it from memory except when something in the stack is still in use. If the stack has been put in use, or has has a script that has been inserted as a frontscript or backscript, it won't be purged. If it is running a process that hasn't been closed (an open driver, for example), or if it has issued a pending message that hasn't completed yet, it won't purge. But if there is nothing in the stack that is still running in memory, it will close and purge.stephenmcnutt wrote:I don't think that's exactly true, FourthWorld. I'm pretty sure I HAVE had destroyStack set to true for all my data stacks all along, but I find "close stack" doesn't really close the stack immediately, and I get errors later when I try to open the stack again only to find it's still open.FourthWorld wrote:Not if you first set the stack's destroyStack property.stephenmcnutt wrote:Must "delete stack" still be used instead of "close stack" to ensure immediate stack closure?
I have set my LC preferences to always create new stacks with deleteStack set to true and as long as I remember the restrictions I've had no problems. I never use "delete stack."
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: Fixed Yet? Three Questions
...although notice that the LC preference only applies to stacks created from the menu.
If you create stacks from a script or the messagebox, i.e.,' create stack "myAboutStack"', the destroyStack property will be false.
If you create stacks from a script or the messagebox, i.e.,' create stack "myAboutStack"', the destroyStack property will be false.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev