<doc>
  <legacy_id>1919</legacy_id>
  <name>number</name>
  <type>function</type>
  <syntax>
    <example>the number of [card|cd|background|bkgnd|bg] {<i>objectType </i>| parts | controls}</example>
    <example>the number of {<i>objectType </i>| parts | controls} [{in | of}<i> group</i>]</example>
    <example>the number of {backgrounds | groups} [ [{in | of} <i>card</i>] {in | of} <i>stack</i>]</example>
    <example>the number of [marked] cards [{in | of} <i>stack</i>]</example>
    <example>the number of {char[acters] | items | words | lines} {in | of} <i>string</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
    <synonym>num</synonym>
  </synonyms>
  <classification>
    <category>Objects &amp; Messages</category>
    <category>Text and Data Processing</category>
  </classification>
  <references>
    <function tag="length">length Function</function>
    <property tag="layer">layer Property</property>
    <keyword tag="control">control Keyword</keyword>
  </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><glossary tag="return">Returns</glossary> the number of <glossary tag="object">objects</glossary> of a certain kind, or the number of <glossary tag="chunk">chunks</glossary> in a <keyword tag="string">string</keyword>.</summary>
  <examples>
    <example>repeat for the number of words in inputString</example>
    <example>if the number of card buttons &gt; 0 then doTheButtons</example>
  </examples>
  <description>
    <p>Use the <b>number</b> <control_st tag="function">function</control_st> to find out how many of a thing there are.</p><p/><p><b>Parameters:</b></p><p>The <i>objectType</i> is one of<code> buttons </code>(or<code> btns</code>),<code> fields </code>(or<code> flds</code>),<code> images</code>,<code> graphics </code>(or<code> grcs</code>),<code> players</code>,<code> scrollbars</code>,<code> EPSs</code>,<code> audioClips</code>,<code> videoClips</code>,<code> groups</code>,<code> backgrounds</code>, or<code> cards</code>.</p><p/><p>The <i>group</i> is a <href tag="reference/object_reference.rev">reference</href> to any <command tag="group">group</command> in the <glossary tag="current stack">current stack</glossary>.</p><p/><p>The <i>stack</i> is any <href tag="reference/object_reference.rev">stack reference</href>.</p><p/><p>The <i>string</i> is any <keyword tag="string">string</keyword> or <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>number</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> a <href tag="../glossary/nondashnegative.xml">non-negative</href> <keyword tag="integer">integer</keyword>.</p><p/><p><b>Comments:</b></p><p>If you use the form<code> the number of card controls</code>, the <b>number</b> <control_st tag="function">function</control_st> returns the number of <glossary tag="control">controls</glossary> on the <glossary tag="current card">current card</glossary> that are not members of a <command tag="group">group</command>. The form<code> the number of background controls </code>returns the number of grouped controls that are in a <command tag="group">group</command> whose <property tag="backgroundBehavior">backgroundBehavior</property> <glossary tag="property">property</glossary> is set to true.</p><p/><p>The expression</p><p><code>  the number of chars in <i>string</i></code></p><p>is equivalent t<code>o</code></p><p><code>  the length of <i>string</i></code></p><p/><p>The expression <code>the number of backgrounds of <i>stack</i></code> <glossary tag="return">returns</glossary> the number of <glossary tag="group">groups</glossary> in the <i>stack</i>. The <glossary tag="expression">expression</glossary> <code>the number of groups of <i>stack</i> </code>returns the number of groups on the <glossary tag="current card">current card</glossary> of the <i>stack</i>. <glossary tag="group">groups</glossary> that are <glossary tag="nest">nested</glossary> inside another <command tag="group">group</command> are not counted.</p><p/><p><code/><b>Note:</b><code/> The <b>number</b> is implemented as a <href tag="../glossary/readdashonly.xml">read-only</href> <command tag="global">global</command> <glossary tag="property">property</glossary>, but can be more conveniently thought of as a <control_st tag="function">function</control_st>.</p>
  </description>
</doc>