<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>CFEXIT</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">CFEXIT</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>
現在実行中の CFML カスタムタグの処理を中止します。また、現在実行中の CFML カスタムタグ内のページを終了するか、現在実行中の CFML カスタムタグ内のコードセクションを再実行します。
</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>
デバッグタグ、フロー制御タグ
</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;cfexit
   method = &quot;method&quot;&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、cfif、cflocation、cfloop、cfswitch、cfthrow、cftry、『ColdFusion MX 開発ガイド』の第2章の「CFML の要素」 の「cfabort と cfexit」
</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>
ベースページ内やインクルードページ内など、カスタムタグのコンテキスト外で cfexit タグが検出されると、cfabort と同様の処理が行われます。cfexit タグを使用すると、カスタムタグ内のエラーチェックと検証のための論理式を簡略化することができます。 
</p>

<p>
cfexit タグの機能は、その位置と実行モードによって異なります。
</p>

<p>
</p><div align="left">
<table border="1">
  <caption></caption>
  <tr align="center">    <th><strong>method 属性の値</strong></th>
    <th><strong>cfexit の呼び出し場所</strong></th>
    <th><strong>動作</strong></th>
</tr>
  <tr align="left">    <td>
<p>exitTag</p></td>
    <td>
<p>ベースページ</p></td>
    <td>
<p>処理を終了します。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = Start</p></td>
    <td>
<p>終了タグの後から処理を継続します。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = End</p></td>
    <td>
<p>終了タグの後から処理を継続します。</p></td>
</tr>
  <tr align="left">    <td>
<p>exitTemplate</p></td>
    <td>
<p>ベースページ</p></td>
    <td>
<p>処理を終了します。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = Start</p></td>
    <td>
<p>本文内の最初のサブタグから処理を継続します。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = End</p></td>
    <td>
<p>終了タグの後から処理を継続します。</p></td>
</tr>
  <tr align="left">    <td>
<p>loop</p></td>
    <td>
<p>ベースページ</p></td>
    <td>
<p>エラーになります。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = Start</p></td>
    <td>
<p>エラーになります。</p></td>
</tr>
  <tr align="left">    <td>
<p>&#160;</p></td>
    <td>
<p>Execution mode = End</p></td>
    <td>
<p>本文内の最初のサブタグから処理を継続します。</p></td>
</tr>
</table>
</div>
<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><pre>&lt;h3&gt;cfexit の例&lt;/h3&gt;
&lt;p&gt;cfexit を使用して、現在実行中の CFML カスタムタグの処理を中止することができます。カスタムタグを呼び出
したページ内のカスタムタグ呼び出しの後から実行が再開されます。
&lt;h3&gt;cfexit の使用方法&lt;/h3&gt;
&lt;p&gt;cfexit は、主にカスタムタグの内部で処理の条件付き停止を行うときに使用します。cfexit は、カスタムタグ
を呼び出したページに制御を返します。このタグが他のタグから呼び出されている場合は、呼び出し元のタグに制
御を返します。

&lt;!--- cfexit は、CFML カスタムタグ内で次のように使用できます。 --- ---&gt;
&lt;!--- 該当するセクションのコメントを解除して、このコードを customtags ディレクトリ内に配置します。 ---&gt;

&lt;!--- MyCustomTag.cfm ---&gt;
&lt;!--- この簡単なカスタムタグを使用して、myValue1 と myValue2 が
存在するかどうかを調べます。値が 2 つとも定義されている場合は、
これらの値を追加して、変数 &quot;result&quot; の呼び出しページに
結果を返します。属性値がいずれか一方しか存在しないか、または両方とも存在しない場合は、
エラーメッセージが生成され、
CFEXIT によって呼び出しページに制御権が
返されます。 ---&gt;

&lt;!--- &lt;cfif NOT IsDefined(&quot;attributes.myValue2&quot;)&gt;
         &lt;cfset caller.result = &quot;Value2 が定義されていません。&quot;&gt;
         &lt;cfexit method = &quot;exitTag&quot;&gt;
    &lt;cfelseif NOT IsDefined(&quot;attributes.myValue1&quot;)&gt;
         &lt;cfset caller.result = &quot;Value1 が定義されていません。&quot;&gt;
         &lt;cfexit method = &quot;exitTag&quot;&gt;
    &lt;cfelse&gt;
          &lt;cfset value1 = attributes.myValue1&gt;      
          &lt;cfset value2 = attributes.myValue2&gt;      
         &lt;cfset caller.result = value1 + value2&gt;
    &lt;/cfif&gt; ---&gt;
&lt;!--- MyCustomTag.cfm の終わり ---&gt;

&lt;!--- このコードをページ内に指定 ---&gt;    

&lt;!--- &lt;p&gt;カスタムタグの呼び出しとその結果
&lt;CF_myCustomTag
      myvalue2 = 4&gt;
&lt;cfoutput&gt;#result#&lt;/cfoutput&gt; ---&gt;
&lt;p&gt;cfexit は、カスタムタグの外側で使用されると、cfabort のように機能します。 
たとえば、このメッセージの後ろのテキストは処理されません。
&lt;cfexit&gt;
&lt;p&gt;この上に cfexit タグがあるため、このテキストは実行されません。
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="METHOD">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">METHOD</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> "exitTag"

<ul>

<li>exitTag: 現在実行中のタグの処理を中止します。</li>

<li>exitTemplate: 現在実行中のタグのページを終了します。</li>

<li>loop: 現在実行中のタグの本文を再実行します。</li>
</ul>


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

  </body>
</html>
