<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>LISTQUALIFY</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">LISTQUALIFY</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>
Inserts a string at the beginning and end of list elements.
</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>
A copy of the list, with qualifier before and after the specified element(s).
</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>
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>ListQualify(list, qualifier [, delimiters ] [, elements ])
</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>
"Lists" in Chapter&#160;3, "Using ColdFusion Variables," 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: Changed behavior: as the elements parameter value, you must specify &quot;all&quot; or &quot;char&quot;; otherwise, ColdFusion throws an exception. (In earlier releases, the function ignored an invalid value, and used &quot;all&quot;; this was inconsistent with other 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">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">Usage</span>
<p>
The new list might not preserve all of the delimiters in the list.
</p>

<p>
ColdFusion ignores empty list elements; thus, the list &quot;a,b,c,,,d&quot; has four elements.
</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;cfquery name = &quot;GetEmployeeNames&quot; datasource = &quot;cfdocexamples&quot;&gt;
SELECT    FirstName, LastName
FROM    Employees
&lt;/cfquery&gt;

&lt;h3&gt;ListQualify Example&lt;/h3&gt;
&lt;p&gt;This example uses ListQualify to put the full names of the 
employees in the query within quotation marks.&lt;/p&gt;
&lt;cfset myArray = ArrayNew(1)&gt;

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

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

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

&lt;cfoutput&gt;
   &lt;p&gt;The contents of the unqualified list are as follows:   &lt;/p&gt;
   #myList#
&lt;/cfoutput&gt;

&lt;!--- show the resulting alphabetized array as a qualified list with 
single quotation marks around each full name.    ---&gt;
&lt;cfset qualifiedList1 = ListQualify(myList,&quot;&#39;&quot;,&quot;,&quot;,&quot;CHAR&quot;)&gt;

&lt;!--- output the array as a list ---&gt;
&lt;cfoutput&gt;
   &lt;p&gt;The contents of the qualified list are as follows:   &lt;/p&gt;
   &lt;p&gt;#qualifiedList1#&lt;/p&gt;
&lt;/cfoutput&gt;

&lt;!--- show the resulting alphabetized array as a qualified list with quotation
marks around each full name. We use &amp;quot; to denote quotation marks
because the quotation mark character is a control character. ---&gt;
&lt;cfset qualifiedList2 = ListQualify(myList,&quot;&amp;quot;&quot;,&quot;,&quot;,&quot;CHAR&quot;)&gt;

&lt;!--- output the array as a list ---&gt;
&lt;cfoutput&gt;
   &lt;p&gt;The contents of the second qualified list are:   &lt;/p&gt;
   &lt;p&gt;#qualifiedList2#&lt;/p&gt;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="LIST">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">LIST</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>A list or a variable that contains one. </p>

  </td>
  </tr>
  </table>
</div>
<div id="QUALIFIER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">QUALIFIER</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>A string or a variable that contains one. Character or string to insert before and after the list elements specified in the elements parameter.</p>

  </td>
  </tr>
  </table>
</div>
<div id="DELIMITERS">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DELIMITERS</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>A string or a variable that contains one. Character(s) that separate list elements. The default value is comma. </p>
<p>If this parameter contains more than one character, ColdFusion uses the first character as the delimiter and ignores the remaining characters. </p>

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

<ul>

<li>all: all elements</li>

<li>char: elements that are composed of alphabetic characters </li>
</ul>


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

  </body>
</html>
