<doc>
  <legacy_id>1396</legacy_id>
  <name>element</name>
  <type>keyword</type>
  <syntax>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Writing LiveCode</category>
    <category>Values &amp; Properties</category>
  </classification>
  <references>
    <keyword tag="each">each Keyword</keyword>
    <keyword tag="item">item Keyword</keyword>
    <control_st tag="repeat">repeat Control Structure</control_st>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Used with the <control_st tag="repeat">repeat</control_st> <glossary tag="control structure">control structure</glossary> to specify that the statements in the repeat loop will be executed once for each <keyword tag="element">element</keyword> in an <glossary tag="array">array</glossary>.</summary>
  <examples>
    <example>repeat for each element thisMonth in monthlyReceivables</example>
  </examples>
  <description>
    <p>Use the <b>element</b> <glossary tag="keyword">keyword</glossary> to perform an action on all the elements of an <glossary tag="array">array</glossary>.</p><p/><p><b>Comments:</b></p><p>The word after the phrase<code> for each element </code>is a variable name. The value of each element is placed in this variable during that iteration of the <b>repeat</b> loop.</p><p/><p>The structure</p><p/><p><code>  repeat for each element myElement in myArray</code></p><p><code/>    ...</p><p><code>  end repeat</code></p><p/><p>is equivalent to</p><p/><p><code>  repeat with x = 1 to the number of lines in the keys of myArray</code></p><p><code>    put myArray[line x of the keys of myArray] into myElement</code></p><p><code/>    ...</p><p><code>  end repeat</code></p><p/><p>However, the first form, using the <b>element</b> <glossary tag="keyword">keyword</glossary>, is much faster.</p>
  </description>
</doc>