<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ARRAYDELETEAT</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">ARRAYDELETEAT</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>
Deletes an element from an array. 
</p>

<p>
When an element is deleted, ColdFusion recalculates index positions. For example, in an array that contains the months of the year, deleting the element at position 5 removes the entry for May. After this, to delete the entry for June, you would delete the element at position 5 (not 6).
</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>
True, on successful completion. 
</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>ArrayDeleteAt(array, position)
</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">See also</span>
<p>
ArrayInsertAt; "Functions for XML object management" in Chapter&#160;35, "Using XML and WDDX," in ColdFusion MX Developer's Guide
</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">History</span>
<p>
ColdFusion&#160;MX:
</p>
<ul>

<li>Changed behavior: this function can be used on XML objects.</li>

<li>Changed thrown exceptions: this function can throw the InvalidArrayIndexException error.</li>
</ul>
    </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">Throws</span>
<p>
If this function attempts to delete an element at position 0, or specifies a value for position that is greater than the size of array, this function throws an InvalidArrayIndexException error. 
</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;ArrayDeleteAt Example&lt;/h3&gt;&lt;p&gt;
&lt;!--- create an array ---&gt;
&lt;cfset DaysArray = ArrayNew(2)&gt;
&lt;!--- populate an element or two ---&gt;
&lt;cfset DaysArray[1][1] = &quot;Monday&quot;&gt;
&lt;cfset DaysArray[2][1] = &quot;Tuesday&quot;&gt;
&lt;cfset DaysArray[3][1] = &quot;Wednesday&quot;&gt;
&lt;cfset DaysArray[1][2] = &quot;April 12&quot;&gt;
&lt;cfset DaysArray[2][2] = &quot;April 13&quot;&gt;
&lt;cfset DaysArray[3][2] = &quot;April 14&quot;&gt;
&lt;p&gt;This is what the array looks like before delete:&lt;br&gt;
&lt;cfoutput&gt;
#DaysArray[1][1]#&amp;nbsp;&amp;nbsp;#DaysArray[1][2]#&lt;br&gt;
#DaysArray[2][1]#&amp;nbsp;&amp;nbsp;#DaysArray[2][2]#&lt;br&gt;
#DaysArray[3][1]#&amp;nbsp;&amp;nbsp;#DaysArray[3][2]#&lt;br&gt;
&lt;/cfoutput&gt;

&lt;cfoutput&gt;
We delete this element of the array:&lt;br&gt;
#ArrayDeleteAt(DaysArray,2)#&lt;br&gt;
&lt;/cfoutput&gt;
&lt;!--- the formerly third element, &quot;Wednesday&quot; is second element ---&gt;
&lt;p&gt;This is what the array looks like after delete:&lt;br&gt;
&lt;cfoutput&gt;
#DaysArray[1][1]#&amp;nbsp;&amp;nbsp;#DaysArray[1][2]#&lt;br&gt;
#DaysArray[2][1]#&amp;nbsp;&amp;nbsp;#DaysArray[2][2]#&lt;br&gt;
&lt;/cfoutput&gt; 
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ARRAY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ARRAY</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>Name of an array</p>

  </td>
  </tr>
  </table>
</div>
<div id="POSITION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">POSITION</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>Array position</p>

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

  </body>
</html>
