Hi Robert. I already know there is a problem closing a stack which a running handler belonging to that stack (I have destroyStack on because I want to remove the module from memory when I am not using it). This has actually been discussed a while back. Someone else was having the same issue. It seems if it’s the last command executed, it works, but if there is any script that runs after that, such as an on closeStack or on closeStackRequest (which I have) then (obviously) the command cannot complete. It would have to prematurely terminate running scripts. I’m pretty sure that is the issue.
The Idle option seems to work fine. In fact it’s the only option that works at all in this scenario! Thanks for the reply though. Bob S On May 21, 2014, at 11:48 , Robert Brenstein <r...@robelko.com<mailto:r...@robelko.com>> wrote: On 21.05.2014 at 18:31 Uhr +0000 Bob Sneidar apparently wrote: Okay well that is making a little more sense. So if I put an on idle handler in all my stacks and then pass the message, it should filter down to my mainstack. I suppose I could insert the stack-closing-code in all my substacks, but that makes me feel dirty somehow. ;-) Bob S Idle is not the way to go IMHO. Try the flight recorder to see what is really going on. From a design point of view, a strategy to handle opening and closing work stacks (substacks) from a script in the mainstack should work. However, the substacks must have the destroystack property set and do not have any messages in the pending queue among others. Have you checked frontscripts? RObert _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode