Library Stack Inquiry

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Library Stack Inquiry

Post by WaltBrown » Thu Oct 07, 2010 10:08 pm

Has anyone a link to a tutorial or article on decoding the issues with using library stacks and calling subroutines? I am having a very hard time figuring out the issues with exactly where and when the defaultStack property and the message path changes as library subroutines are used. I do not appear to be getting consistent assumptions between library routine and application routine calls to stack objects.

Thanks, Walt
Walt Brown
Omnis traductor traditor

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Library Stack Inquiry

Post by Mark » Sun Oct 10, 2010 5:10 pm

Hi Walt,

The defaultStack is often the stack containing the target. This can be a button being clicked by the user or a card receiving an idle message. When you use the go command, the defaultStack changes to the newly opened stack. Naturally, you can always set the defaultStack explicitly. In all other cases, you can assume that the topstack is also the defaultStack.

What kind of issues are you having?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Library Stack Inquiry

Post by WaltBrown » Sun Oct 10, 2010 10:17 pm

Thanks Mark. I had a series of specific issues with the defaultStack changing. I have since made myself a workaround for that and defaultFolder, but it then overrides LC's method. I was wondering if there was an "all-in-one-place" explanation that anyone had seen.
Walt
Walt Brown
Omnis traductor traditor

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Library Stack Inquiry

Post by Simon Knight » Mon Oct 11, 2010 8:07 am

Hi Walt,
Re:
Has anyone a link to a tutorial or article on decoding the issues with using library stacks and calling subroutines?
I found that I was getting tied up in knots when attempting to use library stacks. I started a thread named "confused by library stacks" which may be of some help - I think the following is a link.

http://forums.runrev.com/phpBB2/viewtop ... 634#p26634

I also posted a livecode file that attempts to show when and how subroutines are placed in the message path (scope). Its not a the tutorial you requested but it may be of help.

Best wishes

Simon
best wishes
Skids

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Library Stack Inquiry

Post by WaltBrown » Tue Oct 12, 2010 5:24 am

Excellent, thanks Simon.
Walt Brown
Omnis traductor traditor

Post Reply