Page 1 of 1
Library Stack Inquiry
Posted: Thu Oct 07, 2010 10:08 pm
by WaltBrown
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
Re: Library Stack Inquiry
Posted: Sun Oct 10, 2010 5:10 pm
by Mark
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
Re: Library Stack Inquiry
Posted: Sun Oct 10, 2010 10:17 pm
by WaltBrown
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
Re: Library Stack Inquiry
Posted: Mon Oct 11, 2010 8:07 am
by Simon Knight
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
Re: Library Stack Inquiry
Posted: Tue Oct 12, 2010 5:24 am
by WaltBrown
Excellent, thanks Simon.