<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ARRAYTOLIST</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">ARRAYTOLIST</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>
Converts a one-dimensional array to a list.
</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>
Delimited list, as a string. 
</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, Conversion functions, List 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>ArrayToList(array [, delimiter ])
</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;ArrayToList Example&lt;/h3&gt;

&lt;cfquery name = &quot;GetEmployeeNames&quot; datasource = &quot;cfdocexamples&quot;&gt;
SELECT FirstName, LastName FROM Employees
&lt;/cfquery&gt;

&lt;!--- create an array ---&gt;
&lt;cfset myArray = ArrayNew(1)&gt;

&lt;!--- loop through query, append names successively to last element ---&gt;
&lt;cfloop query = &quot;GetEmployeeNames&quot;&gt;
   &lt;cfset temp = ArrayAppend(myArray, &quot;#FirstName# #LastName#&quot;)&gt;
&lt;/cfloop&gt;

&lt;!--- show the resulting array as a list ---&gt;
&lt;cfset myList = ArrayToList(myArray, &quot;,&quot;)&gt;

&lt;!--- sort that array descending alphabetically ---&gt;
&lt;cfset myAlphaArray = ArraySort(myArray, &quot;textnocase&quot;, &quot;desc&quot;)&gt;

&lt;!--- show the resulting alphabetized array as a list ---&gt;
&lt;cfset myAlphaList = ArrayToList(myArray, &quot;,&quot;)&gt;

&lt;!--- output the array as a list ---&gt;
&lt;cfoutput&gt;
   &lt;p&gt;The contents of the array are as follows:
   &lt;p&gt;#myList#
   &lt;p&gt;This array, alphabetized by first name (descending):
   &lt;p&gt;#myAlphaList#
   &lt;p&gt;This array has #ArrayLen(MyArray)# elements.
&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 array </p>

  </td>
  </tr>
  </table>
</div>
<div id="DELIMITER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DELIMITER</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>Character or multicharacter string to separate list elements. The default value is comma.</p>

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

  </body>
</html>
