<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFLOOP: リストまたはファイルに対するループ</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFLOOP: リストまたはファイルに対するループ</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">説明</span>
<p>
リストに対してループを行うと、次のエンティティ内に含まれている要素が順次使用されます。
</p>
<ul>

<li>変数</li>

<li>式から返される値</li>

<li>ファイル</li>
</ul>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfloop
   index = &quot;index_name&quot;
   list = &quot;list_items&quot;
   delimiters = &quot;item_delimiter&quot;&gt;
   ...
&lt;/cfloop&gt;
</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">関連項目</span>
<p>
cfabort、cfbreak、cfexecute、cfexit、cfif、cflocation、cfswitch、cfthrow、cftry、『ColdFusion MX 開発ガイド』の第2章の「CFML の要素」 の「cfloop と cfbreak」
</p>

<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">例</span>
<p>
このループでは 4 つの名前を表示します。
</p>
<pre>&lt;cfloop index = &quot;ListElement&quot;
   list = &quot;John,Paul,George,Ringo&quot;&gt; 
      &lt;cfoutput&gt;#ListElement#&lt;/cfoutput&gt;&lt;br&gt; 
&lt;/cfloop&gt;
</pre>
<p>
delimiters 属性に、任意の順序で複数の文字を入れることができます。たとえば、次のループではカンマ、コロン、スラッシュがリストの区切り文字として処理されます。
</p>
<pre>&lt;cfloop index = &quot;ListElement&quot;
   list = &quot;John/Paul,George::Ringo&quot;
   delimiters = &quot;,:/&quot;&gt; 
      &lt;cfoutput&gt;#ListElement#&lt;/cfoutput&gt;&lt;br&gt; 
&lt;/cfloop&gt;
</pre>
<p>
リスト要素間にある、連続する 2 つめ以降の区切り文字はスキップされます。したがって、前の例では、&quot;George&quot; と &quot;Ringo&quot; の間の 2 つのコロンは、1 つの区切り文字として処理されます。
</p>

<p>
ファイルの各行をループするには、このタグを次のように使用します。
</p>
<pre>&lt;cfloop list=&quot;#theFile#&quot;
   index=&quot;curLine&quot;
   delimiters=&quot;#chr(10)##chr(13)#&quot;&gt; 
   ...
&lt;/cfloop&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="INDEX">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">INDEX</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>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>リストループ内で次のリスト要素を受け取る変数です。</p>

  </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>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>リスト、変数、またはファイル名です。これらにはリストが含まれます。</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>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>リスト内の項目の区切り文字です。</p>

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

  </body>
</html>
