<doc>
  <legacy_id>1675</legacy_id>
  <name>saveStackRequest</name>
  <type>message</type>
  <syntax>
    <example>saveStackRequest</example>
  </syntax>
  <library></library>
  <objects>
    <card/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
  </classification>
  <references>
    <property tag="filename">filename Property</property>
    <message tag="closeStack">closeStack Message</message>
    <property tag="filename of stack">filename of stack Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent to the <glossary tag="current card">current card</glossary> when the <object tag="stack">stack</object> is about to be saved.</summary>
  <examples>
    <example>on saveStackRequest <code><i>-- delete all cards but the first</i></code></p><p>  repeat with x = the number of cards down to 2</p><p>    delete card x</p><p>  end if</p><p>  pass saveStackRequest <code><i>-- or the stack won't be saved</i></code></p><p>end saveStackRequest</example>
  </examples>
  <description>
    <p>Handle the <b>saveStackRequest</b> <keyword tag="message box">message</keyword> if you need to do cleanup or other actions before a <object tag="stack">stack</object> is saved. For example, if the <object tag="stack">stack</object> creates temporary <glossary tag="object">objects</glossary> that should not be saved with the <object tag="stack">stack</object>, you can write a <b>saveStackRequest</b> <glossary tag="handler">handler</glossary> to delete those <glossary tag="object">objects</glossary> before the <object tag="stack">stack</object> is saved.</p><p/><p><b>Comments:</b></p><p>The save action is triggered by the <b>saveStackRequest</b> <keyword tag="message box">message</keyword>. This means that <glossary tag="trap">trapping</glossary> the <b>saveStackRequest</b> <keyword tag="message box">message</keyword> and not <glossary tag="pass">passing</glossary> it prevents the <object tag="stack">stack</object> from being saved. The LiveCode IDE locks messages when Save or Save As... are chosen from the File menu to ensure that the save occurs.</p>
  </description>
</doc>