<doc>
	<legacy_id>1653</legacy_id>
	<name>save</name>
	<type>command</type>

	<syntax>
		<example>save <i>stack</i> [as <i>filePath</i>]</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Saves a <glossary tag="stack file">stack file</glossary> on the user's system.</summary>

	<examples>
<example>save stack "project1"</example>
<example>save this stack as "Backup"</example>
<example><p>save stack "project1" as "/Disk/Folder/File"</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<web/>
		<mobile/>
	</classes>

	<security>
		<disk/>
	</security>


	<classification>
		<category>Files, Folders, &amp; Resources</category>
		<category>Standalone Applications</category>
	</classification>

	<references>
		<command tag="create stack">create stack Command</command>
		<property tag="stackFileVersion">stackFileVersion Property</property>
		<keyword tag="as">as Keyword</keyword>
	</references>

	<description>Use the <b>save</b> <glossary tag="command">command</glossary> to save changes to a <object tag="stack">stack</object> or to save a copy of a <object tag="stack">stack</object> into another <keyword tag="file">file</keyword>.<p></p><p><b>Parameters:</b></p><p>The <i>stack</i> is any open <object tag="stack">stack</object>.</p><p></p><p>The <i>filePath</i> specifies the <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> you want to save to. If you specify a name but not a location, LiveCode assumes the <keyword tag="file">file</keyword> is in the <property tag="defaultFolder">defaultFolder</property>. If the <keyword tag="file">file</keyword> does not exist, LiveCode creates it.</p><p></p><p><b>Comments:</b></p><p>The <b>save</b> <glossary tag="command">command</glossary> saves all <function tag="stacks">stacks</function> stored in the same <keyword tag="file">file</keyword> as the specified <object tag="stack">stack</object>. That is, if you save a <glossary tag="main stack">main stack</glossary>, all <property tag="substacks">substacks</property> of that stack are also saved in the same <keyword tag="file">file</keyword>, and if you save a <glossary tag="substack">substack</glossary>, its <glossary tag="main stack">main stack</glossary> and any other <property tag="substacks">substacks</property> are also saved.</p><p></p><p>If the stack has not yet been saved and doesn't have a filename, you must use theform.</p><p></p><p>You cannot save to a standalone application's file; <glossary tag="standalone application">standalones</glossary> are read-only.</p><p></p><p>If the stack cannot be saved (for example, if you try to save it to a nonexistent drive or to a CD-ROM), the <b>result</b> <control_st tag="function">function</control_st> is set to "Can't open stack file".</p></description>
</doc>