shutdown

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
shutdown
Associationscard
Summary

Sent to the current card of the defaultStack when the application is quitting.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
on shutdown
  save stack "Preferences"
  pass shutdown
end shutdown
RelatedProperty: defaultStack, defaultStack
Message: closeStack, closeCard, closeBackground, suspend
Command: quit
Glossary: application, trap, message, current card
Control Structure: pass
Description

Handle the shutdown message if you want to perform cleanup tasks before the application quits.

The actual quit process is not triggered by the shutdown message, so trapping the message and not allowing it to pass does not prevent the application from quitting.

In standalones, some care is needed to ensure you receive the shutdown message if your application uses multiple stacks. The most reliable approach is to install a library stack or backscript to handle the message when your application starts up.

Note: Applications will not receive this message when running in the IDE.

Tagswindowing