<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ARRAYNEW</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">ARRAYNEW</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Creates an array of 1-3 dimensions. Index array elements with square brackets: [ ].
</p>

<p>
ColdFusion arrays expand dynamically as data is added. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
An array
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Array functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>ArrayNew(dimension)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;ArrayNew Example&lt;/h3&gt;
&lt;!--- Make an array ---&gt;
&lt;cfset MyNewArray = ArrayNew(1)&gt;
&lt;!--- ArrayToList does not function properly if the Array is not initialized 
with
ArraySet ---&gt;
&lt;cfset temp = ArraySet(MyNewArray, 1,6, &quot;&quot;)&gt;

&lt;!--- set some elements ---&gt;
&lt;cfset MyNewArray[1] = &quot;Sample Value&quot;&gt;
&lt;cfset MyNewArray[3] = &quot;43&quot;&gt;
&lt;cfset MyNewArray[6] = &quot;Another Value&quot;&gt;

&lt;!--- is it an array? ---&gt;
&lt;cfoutput&gt;
   &lt;p&gt;Is this an array? #IsArray(MyNewArray)#
   &lt;p&gt;It has #ArrayLen(MyNewArray)# elements.
   &lt;p&gt;Contents: #ArrayToList(MyNewArray)#
&lt;!--- the array has expanded dynamically to six elements with the use of 
ArraySet,
even though we only set three values ---&gt;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="DIMENSION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DIMENSION</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Number of dimensions in new array: </p>
<p>1, 2, or 3</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
