<doc>
	<legacy_id>2345</legacy_id>
	<name>combine</name>
	<type>command</type>

	<syntax>
		<example>combine array {using | by | with} primaryDelimiter [and secondaryDelimiter]</example>
		<example>combine array {using | by | with} primaryDelimiter as set</example>
		<example>combine array {using | by | with} {row | column}</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Transforms an <glossary tag="array">array</glossary> into a list. </summary>

	<examples>
<example>combine myArray using comma</example>
<example>combine myArray by row</example>
<example><p>put "apple" into tArray[1]</p><p>put "banana" into tArray[2]</p><p>combine tArray using return and ":"</p><p>   </p><p>## RESULT tArray</p><p>## 1:apple</p><p>## 2:banana</p><p>   </p><p></p><p></p><p></p></example>
	</examples>

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

	<objects>
	</objects>

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

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

	<security>
	</security>


	<classification>
		<category>Values &amp; Properties</category>
	</classification>

	<references>
		<function tag="extents">extents Function</function>
		<function tag="keys">keys Function</function>
		<command tag="split">split Command</command>
		<property tag="columnDelimiter">columnDelimiter Property</property>
		<property tag="rowDelimiter">rowDelimiter Property</property>
		<keyword tag="using">using Keyword</keyword>
		<keyword tag="[]">[] Keyword</keyword>
	</references>

	<description>
	<overview>Use the <b>combine</b> command to display an array in a field or to process an array using string operators, functions, and chunk expressions. </overview>

		<parameters>
  <parameter>
    <name>arrayName</name>
    <description>An array variable.</description>
  </parameter>
  <parameter>
    <name>primaryDelimiter</name>
    <description>A character or expression that resolves to a character.</description>
  </parameter>
  <parameter>
    <name>secondaryDelimiter</name>
    <description>A character or expression that resolves to a character.</description>
  </parameter>		</parameters>

	<value></value>
	<comments>The <b>combine</b> command combines the elements of the array into a single variable. After the command is finished executing, the variable specified by array is no longer an array. <p></p><p>If the first form of the command is used, the elements of the original array are separated by the <i>primaryDelimiter</i>. For example, if the <i>primaryDelimiter</i> is return, the content of each element of the original array appears on a separate line. </p><p></p><p>If you specify a <i>secondaryDelimiter</i>, the key corresponding to each element is added to the element's content, separated from the content by the <i>secondaryDelimiter</i>. For example, if the <i>primaryDelimiter</i> is return and the <i>secondaryDelimiter</i> is tab, each line of the resulting variable contains an element's key, a tab character, and the element's content. If you don't specify a <i>secondaryDelimiter</i>, then the keys are lost in the transformation. </p><p></p><p>If you use the as set form the <b>combine</b> command rebuilds the list using the delimiter passed, the values of the array are ignored.</p><p></p><p></p><note> The order of the elements is not alphabetical or chronological; it is based on the internal hash order of the array. To alphabetize the list, use the sort command:</note><p></p><p>  combine monthlyReceivables using return and comma</p><p>  sort lines of monthlyReceivables by item 2 of each</p><p></p><p>If the second form of the <b>combine</b> command is used, the elements of the original array are considered to be either columns or rows, separated by the <property tag="columnDelimiter">columnDelimiter property</property> or <property tag="rowDelimiter">rowDelimiter property</property> respectively.</p><p></p><p>Combining an array by row converts the array into a table with rows separated by the <property tag="rowDelimiter">rowDelimiter property</property>. Each row in the resulting string is the contents of the corresponding key in the array. </p><p></p><p>Combining an array by column converts the array into a table with columns separated by the <property tag="columnDelimiter">columnDelimiter property</property>. Each column of the resulting string is the contents of the corresponding key in the array.</p><p></p><p></p><note> The combine by row and combine by column forms can only be used with numerically keyed arrays</note><p></p><p></p><change><p>The combine by row / column form was added in 2.8.1</change></comments>
	</description>
</doc>