<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="/feed.php">
        <title>Documentation Center public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements</title>
        <description></description>
        <link>/</link>
        <image rdf:resource="/lib/tpl/dazdoccenter/images/favicon.ico" />
       <dc:date>2026-05-18T02:00:24+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="/lib/tpl/dazdoccenter/images/favicon.ico">
        <title>Documentation Center</title>
        <link>/</link>
        <url>/lib/tpl/dazdoccenter/images/favicon.ico</url>
    </image>
    <item rdf:about="/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start">
        <dc:format>text/html</dc:format>
        <dc:date>2012-03-12T06:02:09+00:00</dc:date>
        <title>Control Statements and Exceptions</title>
        <link>/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start</link>
        <description>
&lt;h1 id=&quot;control_statements_and_exceptions&quot;&gt;Control Statements and Exceptions&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;

&lt;h2 id=&quot;break&quot;&gt;break&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used in &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#dowhile&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;do...while&lt;/a&gt;&lt;/span&gt;, &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#for&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for&lt;/a&gt;&lt;/span&gt;, &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#forin&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for...in&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#while&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;while&lt;/a&gt;&lt;/span&gt; loops, as well as in &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt; blocks, to terminate the execution of the nearest enclosing block.
&lt;/p&gt;

&lt;p&gt;
When a &lt;code&gt;break&lt;/code&gt; statement is encountered in a block, control is passed to the statement (if any) following the end of the nearest enclosing block that it appears in; unless the &lt;code&gt;break&lt;/code&gt; statement is followed by the name of a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#label&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;label&lt;/a&gt;&lt;/span&gt;, in which case control passes to the statement governed by the label.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
In a &lt;code&gt;for&lt;/code&gt; loop.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
In a &lt;code&gt;for&lt;/code&gt; loop, nested with a &lt;code&gt;label&lt;/code&gt;.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;label&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; j &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit2&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; j&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt; label&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statement governed by label&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
In a &lt;code&gt;switch&lt;/code&gt; block, a &lt;code&gt;break&lt;/code&gt; statement is typically placed at the end of each &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt; clause to prevent the interpreter from “falling through” (unless, of course, “falling through” is the desired effect). When the interpreter encounters a &lt;code&gt;break&lt;/code&gt; statement, control is passed to the statement following the nearest enclosing &lt;code&gt;switch&lt;/code&gt; block. If every clause has a corresponding &lt;code&gt;break&lt;/code&gt; statement, at most only one clause&amp;#039;s statements will be executed. If the &lt;code&gt;break&lt;/code&gt; statement is followed by a label name (e.g. &lt;code&gt;label&lt;/code&gt;), when the &lt;code&gt;break&lt;/code&gt; is encountered, control is passed to the statement marked with that label.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		label&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
				&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt; label&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
			&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// *falls through*&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#dowhile&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;do...while&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#for&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#forin&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for...in&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#label&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;label&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#while&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;while&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;case&quot;&gt;case&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement serves as a condition label for &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt; blocks. For each possible condition a &lt;code&gt;switch&lt;/code&gt; statement&amp;#039;s expression can evalute to, a &lt;code&gt;case&lt;/code&gt; is used to identify which statements within the block are to be executed. If the literal value of a &lt;code&gt;case&lt;/code&gt; clause matches the value of the &lt;code&gt;switch&lt;/code&gt; statements&amp;#039; expression, then that &lt;code&gt;case&lt;/code&gt; is executed.
&lt;/p&gt;

&lt;p&gt;
A &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt; statement is typically placed at the end of each &lt;code&gt;case&lt;/code&gt; clause to prevent the interpreter from “falling through” to the next clause. Omitting the &lt;code&gt;break&lt;/code&gt; statement for a given clause, causes every statement in the &lt;code&gt;case&lt;/code&gt; block to be executed, from the matching &lt;code&gt;case&lt;/code&gt; label to the first &lt;code&gt;break&lt;/code&gt; statement, or the end of the &lt;code&gt;switch&lt;/code&gt; block, including the &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#default&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;default&lt;/a&gt;&lt;/span&gt; clause, whichever is encountered first.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples1&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// *falls through*&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// *falls through*&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#default&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;default&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;catch&quot;&gt;catch&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used as a counterpart to &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#try&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;try&lt;/a&gt;&lt;/span&gt; statements for handling exceptions that may occur. If an exception does occur in the statements within the &lt;code&gt;try&lt;/code&gt; block, the statements in the &lt;code&gt;catch&lt;/code&gt; block are executed. &lt;code&gt;catch&lt;/code&gt; blocks are available in two flavors, unqualified and qualified.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Qualified Exceptions:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/object_index/evalerror/start&quot; class=&quot;wikilink2&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:object_index:evalerror:start&quot; rel=&quot;nofollow&quot;&gt;EvalError&lt;/a&gt; - The result of a failed eval() call.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/object_index/rangeerror/start&quot; class=&quot;wikilink2&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:object_index:rangeerror:start&quot; rel=&quot;nofollow&quot;&gt;RangeError&lt;/a&gt; - A result that is out of range (e.g. an array index to beyond the length of the array).&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/object_index/typeerror/start&quot; class=&quot;wikilink2&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:object_index:typeerror:start&quot; rel=&quot;nofollow&quot;&gt;TypeError&lt;/a&gt; - An attempt to perform an operation on an object of an inappropriate type.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; UserDefined Exceptions that are raised by a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#throw&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;throw&lt;/a&gt;&lt;/span&gt; statement.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples2&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Unqualified.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; e &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Qualified.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; e &lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt; e instanceOf &lt;span class=&quot;kw5&quot;&gt;EvalError&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#try&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;try&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#throw&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;throw&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;continue&quot;&gt;continue&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used in &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#dowhile&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;do...while&lt;/a&gt;&lt;/span&gt;, &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#for&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for&lt;/a&gt;&lt;/span&gt;, &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#forin&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for...in&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#while&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;while&lt;/a&gt;&lt;/span&gt; blocks to transfer control to the controlling-expression of the nearest enclosing block. All remaining statements in the current iteration are not executed. If a &lt;code&gt;continue&lt;/code&gt; statement is encountered in a &lt;code&gt;for&lt;/code&gt; block, execution immediately passes to the loop-expression and continues normally (e.g. the controlling-expression is tested, and if found to be &lt;code&gt;true&lt;/code&gt;, the statements in the block are executed).
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples3&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
In a &lt;code&gt;for&lt;/code&gt; loop.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; initializing&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;expression&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; controlling&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;expression&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; loop&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
If a &lt;code&gt;continue&lt;/code&gt; statement is encountered in a &lt;code&gt;do…while&lt;/code&gt; or &lt;code&gt;while&lt;/code&gt; loop, execution immediately passes to the controlling-expression, which is re-evaluated, and if &lt;code&gt;true&lt;/code&gt;, passes control back to the block for further execution.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; controlling&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; controlling&lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#dowhile&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;do...while&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#for&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#forin&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for...in&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#while&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;while&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;default&quot;&gt;default&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used in &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt; blocks to define the default statements to be executed in the event that the &lt;code&gt;switch&lt;/code&gt; statement&amp;#039;s expression doesn&amp;#039;t evaluate to a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt; clause that has been defined. If no &lt;code&gt;default&lt;/code&gt; clause is defined and none of the case clause labels match, the &lt;code&gt;switch&lt;/code&gt; will not execute any statements within the block and control will be passed to the statement following the &lt;code&gt;switch&lt;/code&gt; block. Because each &lt;code&gt;case&lt;/code&gt; is evaluated in ascending order, if a &lt;code&gt;default&lt;/code&gt; clause is used, it should always be the last clause in the &lt;code&gt;switch&lt;/code&gt; block. Because &lt;code&gt;default&lt;/code&gt; is a “catch all” clause, if the interpreter reaches it, it will execute the associated statements.
&lt;/p&gt;

&lt;p&gt;
It is customary to end a &lt;code&gt;default&lt;/code&gt; clause with a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt; statement.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples4&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#switch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;switch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;dowhile&quot;&gt;do...while&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to create a loop that is guaranteed to execute the enclosed statements at least once. If the &lt;code&gt;while&lt;/code&gt; condition evalutes &lt;code&gt;true&lt;/code&gt;, control is passed back to the &lt;code&gt;do&lt;/code&gt; statement and the block is executed again. If the &lt;code&gt;while&lt;/code&gt; condition evaluates &lt;code&gt;false&lt;/code&gt;, control is passed to the statement immediately following the &lt;code&gt;while&lt;/code&gt; statement.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples5&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#while&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;while&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;else&quot;&gt;else&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used in conjunction with the &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#if&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;if&lt;/a&gt;&lt;/span&gt; statement to provide optional statements for execution. If no additional conditions exist, other than that used in the &lt;code&gt;if&lt;/code&gt; block, the &lt;code&gt;else&lt;/code&gt; keyword is used alone. However, if an additional condition does exist, the &lt;code&gt;else&lt;/code&gt; keyword is followed by the &lt;code&gt;if&lt;/code&gt; keyword and the corresponding condition.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples6&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Single condition.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Multiple conditions.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#if&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;if&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/operators/start#ternary&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:operators:start&quot;&gt;(?:) Conditional Operator&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;finally&quot;&gt;finally&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used in conjunction with the &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#try&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;try&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#catch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;catch&lt;/a&gt;&lt;/span&gt; statements to handle errors and provide a sequence of statements to be executed, unconditionally, in the event that an error does occur. The statements enclosed within a &lt;code&gt;try&lt;/code&gt; block will be executed regardless of whether or not a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#return&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;return&lt;/a&gt;&lt;/span&gt; statement is encountered in the associated &lt;code&gt;try&lt;/code&gt; and/or &lt;code&gt;catch&lt;/code&gt; block(s).
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples7&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; e &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2 id=&quot;for&quot;&gt;for&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to create a loop that executes for as long as an expression is &lt;code&gt;true&lt;/code&gt;, typically a fixed number of times.
&lt;/p&gt;

&lt;p&gt;
A &lt;code&gt;for&lt;/code&gt; statement has three expressions that are used to control how the loop is executed:
&lt;/p&gt;

&lt;p&gt;
The first expression is the initializing-expression. This statement is typically used to initialize (and possibly declare) the variable used in the controlling-expression.
&lt;/p&gt;

&lt;p&gt;
The second expression is the controlling-expression. This statement is typically a conditional expression that is evaluated before each iteration of the loop (including before the first iteration). If this expression evaluates &lt;code&gt;false&lt;/code&gt;, the enclosed statements are not executed for that iteration and control is passed to the third expression. If the expression never evaluates &lt;code&gt;true&lt;/code&gt; the enclosed statements are never executed and control is passed to the statement immediately following the &lt;code&gt;for&lt;/code&gt; block.
&lt;/p&gt;

&lt;p&gt;
The third part, the loop-expression, contains a statement that is executed at the end of every iteration. Typically, this part is used to increment the variable initialized in the first expression.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples8&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;forin&quot;&gt;for...in&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to create a loop that executes for each element of an &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/object_index/array/start&quot; class=&quot;wikilink2&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:object_index:array:start&quot; rel=&quot;nofollow&quot;&gt;Array&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples9&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// EXAMPLE NEEDED&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#for&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#forin&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;for...in&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;if&quot;&gt;if&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to conditionally execute a sequence of statements, depending on the value of an expression. If the condition evaluates &lt;code&gt;false&lt;/code&gt;, control is passed to the statement immediately following the &lt;code&gt;if&lt;/code&gt; block. When used in conjunction with an &lt;code&gt;else&lt;/code&gt; and/or &lt;code&gt;else if&lt;/code&gt; block, only the statements enclosed in one of the blocks is executed before passing control to the statement immediately following the block(s).
&lt;/p&gt;

&lt;p&gt;
It is generally considered good practice to enclose the sequence of statements governed by the condition in matching curly braces ({}), for the sake of clarity and to help avoid inadvertent errors. It is, however, valid (albeit not recommended) syntax to omit the curly braces if only one statement is governed by the condition.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples10&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Single condition.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Single condition with optional &lt;code&gt;else&lt;/code&gt; block.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Multiple conditions.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#else&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;else&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;label&quot;&gt;label&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Statements can be labelled. Labels are used to pass control from &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt; statements to a specific statement outside of the enclosing block.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples11&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;OuterLabel&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	InnerLabel&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; j &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; j &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; limit&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; j&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; condition &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt; OuterLabel&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;continue&lt;/span&gt; InnerLabel&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;return&quot;&gt;return&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to return from a &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/declarations/start#function&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:declarations:start&quot;&gt;function&lt;/a&gt; (with the exception of constructors), optionally returning a value from that &lt;code&gt;function&lt;/code&gt;. When a &lt;code&gt;return&lt;/code&gt; statement is encountered, control is passed to the statement following the one that called the &lt;code&gt;function&lt;/code&gt;. If the &lt;code&gt;return&lt;/code&gt; keyword is followed by an expression, the value of the expression is returned to the calling statement.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples12&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; demo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sArg &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;%1 was passed in.&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;arg&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sArg &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sTmp &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; demo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// sTmp = &amp;quot;5 was passed in.&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/declarations/start#function&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:declarations:start&quot;&gt;function&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/operators/start#functionop&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:operators:start&quot;&gt;function Operator&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;switch&quot;&gt;switch&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to provide a multi-way branch by evaluating an expression (only once). It is used in conjunction with the &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#default&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;default&lt;/a&gt;&lt;/span&gt; clauses to determine a statement, or sequence of statements, to execute based on whether the expression evaluates to one of the labels of the defined cases.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples13&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; expression &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;kw5&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#case&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;case&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#default&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;default&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#if&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;if&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#else&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;else&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;throw&quot;&gt;throw&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to generate an error condition to be handled by a &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#catch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;catch&lt;/a&gt;&lt;/span&gt; block. The exception thrown can be any expression.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples14&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; limit &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;RangeError : Index out of range.&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#catch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;catch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#finally&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;finally&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#try&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;try&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;try&quot;&gt;try&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to signify a statement, or sequence of statements, to attempt execution. It is used in conjunction with &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#catch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;catch&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#finally&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;finally&lt;/a&gt;&lt;/span&gt; blocks to handle errors that may occur.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples15&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; e &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#catch&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;catch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#finally&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;finally&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;while&quot;&gt;while&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to execute a statement, or sequence of statements, until a boolean expression evaluates &lt;code&gt;false&lt;/code&gt;. The expression is tested before each iteration of the loop, and if &lt;code&gt;true&lt;/code&gt;, executes the enclosed statement(s). If the expression evaluates &lt;code&gt;false&lt;/code&gt;, control is passed to the statement immediately following the enclosing block.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples16&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;
	i&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// ...statements&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;strong&gt;See also:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#break&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;curid&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/language_reference/control_statements/start#continue&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:language_reference:control_statements:start&quot;&gt;continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;with&quot;&gt;with&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This statement is used to establish the default object for a block of code, to indicate that any unqualified names should be qualified with the provided object. It is commonly used to shorten the length of code that has to be written for a given segment of code.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;examples17&quot;&gt;Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
More code.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// EXAMPLE NEEDED&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Same result, less code.
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// EXAMPLE NEEDED&lt;/span&gt;&lt;/pre&gt;
&lt;!-- EDIT1 PLUGIN_WRAP_START [0-] --&gt;&lt;div class=&quot;wrap_center wrap_round wrap_info plugin_wrap&quot; style=&quot;width: 80%;&quot;&gt;
&lt;p&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Leaving the interpreter to do the lookup for you may be slower than providing the fully qualified names.
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT2 PLUGIN_WRAP_END [0-] --&gt;
&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
