<doc>
	<legacy_id>1968</legacy_id>
	<name>add</name>
	<type>command</type>

	<syntax>
		<example>add <i>number</i> to [<i>chunk</i> of] <i>container</i></example>
		<example>add {<i>number </i>| <i>array</i>} to <i>arrayContainer</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Adds a number to a <glossary tag="container">container</glossary> and places the resulting <function tag="value">value</function> in the <glossary tag="container">container</glossary>.</summary>

	<examples>
<example>add 7 to field 1</example>
<example>add field "New" to tSummaryOfInventory</example>
<example><p>add (qty * price) to last line of tOrder</p></example>
	</examples>

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

	<objects>
	</objects>

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

	<classes>
		<desktop/>
		<server/>
		<web/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Math, Logic, &amp; Dates</category>
	</classification>

	<references>
		<function tag="sum">sum Function</function>
		<command tag="multiply">multiply Command</command>
		<command tag="union">union Command</command>
	</references>

	<description>Use the <b>add</b> <glossary tag="command">command</glossary> to add a number to a <glossary tag="container">container</glossary> or a portion of a <glossary tag="container">container</glossary>, or to add two <glossary tag="array">arrays</glossary> containing numbers.<p></p><p><b>Parameters:</b></p><p>The <i>number</i> is an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a number.</p><p>The <i>chunk</i> is a <glossary tag="chunk expression">chunk expression</glossary> specifying a portion of the <i>container</i>.</p><p>The <i>container</i> is a <keyword tag="field">field</keyword>, <keyword tag="button">button</keyword>, or <glossary tag="variable">variable</glossary>, or the <keyword tag="message box">message box</keyword>.</p><p>The <i>arrayContainer</i> is an <glossary tag="array">array</glossary> <glossary tag="variable">variable</glossary> each of whose <glossary tag="element">elements</glossary> is a number.</p><p></p><p><b>Comments:</b></p><p>The contents of the <i>container</i> (or the <i>chunk</i> of the <i>container</i>) must be a number or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a number.</p><p></p><p>If a <i>number</i> is added to an <i>arrayContainer</i>, the <i>number</i> is added to each <keyword tag="element">element</keyword>. If an <i>array</i> is added to an <i>arrayContainer</i>, both <glossary tag="array">arrays</glossary> must have the same number of <glossary tag="element">elements</glossary> and the same dimension, and each <keyword tag="element">element</keyword> in the <i>array</i> is added to the corresponding <keyword tag="element">element</keyword> of the <i>arrayContainer</i>.</p><p></p><p>If the <i>container</i> or an <keyword tag="element">element</keyword> of the <i>arrayContainer</i> is empty, the <b>add</b> <glossary tag="command">command</glossary> treats its contents as zero.</p><p>If <i>container</i> is a <keyword tag="field">field</keyword> or <keyword tag="button">button</keyword>, the <function tag="format">format</function> of the sum is determined by the <property tag="numberFormat">numberFormat</property> <glossary tag="property">property</glossary>.</p><p></p><p></p><change><p>The add to <i>arrayContainer</i> form was introduced in version 1.1. In previous versions, only single numbers could be used with the <b>add</b> <glossary tag="command">command</glossary>.</change></description>
</doc>