"Close Stack" Doesn't Close Stack

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

stephenmcnutt
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Fri Nov 10, 2006 8:58 pm
Contact:

Re: "Close Stack" Doesn't Close Stack

Post by stephenmcnutt » Sun Jun 16, 2013 11:20 pm

Thanks a lot, Jacque. I see what you mean about it not really being a bug. My complaint is that the LC Dictionary doesn't give enough information about these subtleties. I've found over the years that you really can't learn LC completely from the official documentation. There seems to be extra and occasionally essential knowledge that seems to exist only in some sort of oral tradition in the forums.

The whole idea of having a stack open but not in the message stack is new to me. I'll have to reread your replies a few times and see if I can figure out something that works for me.

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

Re: "Close Stack" Doesn't Close Stack

Post by jacque » Mon Jun 17, 2013 5:41 pm

One place to look for info is in the dictionary under the "mode" keyword. Stacks can be open in many different modes, and it can get confusing, but the mode of a stack often determines whether or not it is the defaultstack or the topstack, or both, or neither. The "destroystack" entry also gives some info, and explains the issues you were having.

The concept of leaving a stack loaded into RAM but basically inactive goes way back to when computers were slow and opening a stack took time. The original developer of MetaCard wanted raw speed, so left the stack in memory by default. These days it isn't so important and I always change my LiveCode pref to create new stacks with destroystack set to true by default.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stephenmcnutt
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Fri Nov 10, 2006 8:58 pm
Contact:

Re: "Close Stack" Doesn't Close Stack

Post by stephenmcnutt » Thu Jul 18, 2013 6:36 pm

Good news. Simply using "delete stack" instead of "close stack" does the trick. It seems to be really "closing" the stack immediately when I use "delete stack" unlike when I use "close stack". It makes me a little nervous using a command with such a dangerous sounding name, but it seems it really doesn't delete the stacks in my case since they're NOT substacks.

I have to say this seems wrong, though. "Close stack" should close the stack immediately--or at least the cases in which it doesn't act immediately should be documented in the LiveCode Dictionary. I'm not an expert, and perhaps I'm just not seeing the big picture, but LiveCode is supposed to be the friendly language, right? It should behave as you'd expect, and "close stack" doesn't in some cases. And we shouldn't be issuing a "delete stack" command unless we really mean to delete the darn thing. Am I wrong?

Post Reply