<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>
from 属性と to 属性で指定された日付と時刻の範囲をループします。デフォルトの数値単位は 1 日ですが、タイムスパンを作成することによりこの値を変更できます。このタイプの cfloop タグは、cfoutput タグ内で使用できないタグに対してループを行います。 
</p>
  <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
   from = &quot;start_time&quot;
   to = &quot;end_time&quot;
   index = &quot;current_value&quot;
   step = &quot;increment&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、cfdirectory、cfexecute、cfexit、cfif、cflocation、cfrethrow、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>
次の例では、今日の日付から今日の日付に 30 日を加えた日付まで、一度に 7 日ずつループして、日付を表示します。
</p>
<pre>&lt;cfset startDate = Now()&gt; 
&lt;cfset endDate = Now() + 30&gt;
&lt;cfloop from=&quot;#startDate#&quot; to=&quot;#endDate#&quot; index=&quot;i&quot; step=&quot;#CreateTimeSpan(7,0,0,0)#&quot;&gt;
  &lt;cfoutput&gt;#dateformat(i, &quot;mm/dd/yyyy&quot;)#&lt;br /&gt;&lt;/cfoutput&gt;
&lt;/cfloop&gt;
</pre>
<p>
次の例では、夜中の 0 時から 23 時 59 分 59 秒まで、時間を 30 分ずつ加算して表示します。
</p>
<pre>&lt;cfset startTime = CreateTime(0,0,0)&gt; 
&lt;cfset endTime = CreateTime(23,59,59)&gt; 
&lt;cfloop from=&quot;#startTime#&quot; to=&quot;#endTime#&quot; index=&quot;i&quot; step=&quot;#CreateTimeSpan(0,0,30,0)#&quot;&gt; 
 &lt;cfoutput&gt;#TimeFormat(i, &quot;hh:mm tt&quot;)#&lt;br /&gt;&lt;/cfoutput&gt;
&lt;/cfloop&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="FROM">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">FROM</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="TO">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TO</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="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">

<strong>Default value:</strong> "1 day"


<p>インデックスの値です。この値は最初 from 属性の値に設定され、step 属性の値ずつ、to 属性の値まで加算されます。</p>

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