Thanks for the warning! I was also surprised that "this stack" did in fact point to my app stack and not the stack that the code was running from. I think I will change my handler to have a parameter that explicitly names the stack as you suggest.

Pete Haworth

On Apr 18, 2010, at 6:34 AM, use-revolution-requ...@lists.runrev.com wrote:


On Apr 17, 2010, at 12:25 PM, Peter Haworth wrote:

Instead of passing in the name of the app stack, I found I could the use "the long name of this stack", eg:

set the mainstack of stack "Structures" to the mainstack of the long name of this stack

I myself never trust "this stack" even when I'm totally utterly certain that I know what stack "this stack" will refer to when my handler is run. I tend to envision, subconsciously, "this stack" to be, well, "THIS stack", the stack the control is in, or the stack I have in mind, the stack in front of me. But to Rev, "this stack" is the default stack, and if your script wanders into a palette or modeless stack someday, "this stack" will refer to "that stack over there" and suddenly stuff is happening behind your back to the wrong stack! Having been bitten countless times, when I write library utilities now, I insist that the target of actions be specified explicitly, usually via a parameter.


t


_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to