Close Stack Cleanup
J. Landman Gay
jacque at hyperactivesw.com
Thu Feb 4 17:52:53 EST 2021
There used to be a gREV* global variable that tracked the dirty status and if the stack was
dirty it put up the "do you want to save?" dialog. I can't find it now so something has
changed. When it existed, you could toggle that variable via script and the IDE wouldn't bother
The IDE does pass the closeStackRequest to your stack after it checks the stack status. The
docs are correct that you don't get that message when a script closes the stack but you can use
closeStack instead; however, first we need to find out where that variable went to. It used to
be in the globals pane of the message watcher, and I'd recognize it if I saw it, but I can't
remember now what it was.
On 2/4/21 12:59 PM, Bob Sneidar via use-livecode wrote:
> Hi all.
> I know we have tread this ground before, but I am trying to clean up my stack (i.e. clear the fields), then save it when I close it BY ANY MEANS. That means by script, by menu OR by clicking the red dot (of for WIN users the red X) in the title bar. I need this to work in the IDE as well as in standalone.
> You would think closeStackRequest gets sent when I click the red dot or X. You would be mistaken.
> The dictionary reads,
> The closeStackRequest message is only sent if the request to close a stack is initiated by the user (eg by clicking file -> close in the LiveCode menu). If the request is initiated from a script (eg "close this stack" ) then the closeStackRequest message is not sent.
> Apparently clicking the red dot is not considered, “initiated by the user.” It ought to be.
> If I use “CloseStack” instead, I cannot save the stack because a script is currently running, and I do not want to be presented with the dialog to save, do not save, or cancel. I just want it to be saved. I can force quit if I mess something up.
> Bob S
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode