<doc>
  <legacy_id>1632</legacy_id>
  <name>defaultStack</name>
  <type>property</type>
  <syntax>
    <example>set the defaultStack to <i>stackName</i></example>
  </syntax>
  <library></library>
  <objects>
    <global/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Objects &amp; Messages</category>
  </classification>
  <references>
    <command tag="call">call Command</command>
    <command tag="import">import Command</command>
    <function tag="clickStack">clickStack Function</function>
    <function tag="mainStacks">mainStacks Function</function>
    <message tag="shutdown">shutdown Message</message>
    <object tag="stack">stack Object</object>
  </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>Specifies which <object tag="stack">stack</object> the <glossary tag="expression">expression</glossary> <code>this stack</code> <glossary tag="evaluate">evaluates</glossary> to, if no <object tag="stack">stack</object> is specified in a <glossary tag="statement">statement</glossary>.</summary>
  <examples>
    <example>set the defaultStack to "Help"</example>
    <example>set the defaultStack to the topStack</example>
  </examples>
  <description>
    <p>Use the <b>defaultStack</b> <glossary tag="property">property</glossary> to ensure that actions are performed on the correct <object tag="stack">stack</object>.</p><p/><p><b>Value:</b></p><p>The <b>defaultStack</b> is the <property tag="name">name</property> of an open <object tag="stack">stack</object>.</p><p/><p><b>Comments:</b></p><p>If no stack is specified in a statement that applies to a stack, LiveCode assumes the <b>defaultStack</b> is the <object tag="stack">stack</object> meant. For example, the following <glossary tag="statement">statement</glossary> causes the <b>defaultStack</b> to move to its next <keyword tag="card">card</keyword>:</p><p/><p><code>  go next card -- of the current defaultStack</code></p><p/><p>The expression<code> this card </code>refers to the current card of the <b>defaultStack</b>.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> You cannot use a <href tag="reference/object_reference.rev">stack reference</href>, only a <object tag="stack">stack</object> <property tag="name">name</property> or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <object tag="stack">stack</object> <property tag="name">name</property>. For example, the following <glossary tag="statement">statement</glossary> causes an <glossary tag="error">error</glossary>:</p><p/><p><code>  set the defaultStack to stack "Hmm" </code>-- <code/><b>WON'T WORK</b><code/></p><p/><p>but the following statements are correct:</p><p/><p><code>  set the defaultStack to "Hmm"</code></p><p><code/>  set the defaultStack to ("stack" &amp;&amp; quote &amp; "Hmm" &amp; quote)</p><p/><p>The <b>defaultStack</b> <glossary tag="property">property</glossary> is particularly useful in <function tag="stacks">stacks</function> opened in a mode other than an <glossary tag="editable window">editable window</glossary> (such as <function tag="stacks">stacks</function> that are being used as <glossary tag="dialog box">dialog boxes</glossary>, <glossary tag="palette">palettes</glossary>, or <function tag="menus">menus</function>). LiveCode's <keyword tag="message box">message box</keyword> and editing <glossary tag="palette">palettes</glossary> set the <b>defaultStack</b> <glossary tag="property">property</glossary> to the <function tag="value">value</function> <glossary tag="return">returned</glossary> by the <function tag="topStack">topStack</function> <control_st tag="function">function</control_st> before performing a stack action.</p>
  </description>
</doc>