<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>CFDEFAULTCASE</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">CFDEFAULTCASE</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>
cfswitch タグ本文でのみ使用されます。cfswitch タグ内に指定された式が cfcase タグで指定された値に一致しないときに実行されるコードを含みます。
</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;cfdefaultcase&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>
cfcase、cfswitch、『ColdFusion MX 開発ガイド』の第2章の「CFML の要素」 の「cfswitch、cfcase、および cfdefaultcase」
</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>
ColdFusion&#160;MX: 配置の必要条件が変更されました。このタグは、cfswitch タグ本文の中にあるすべての cfcase タグよりも後に記述する必要はありません。
</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>
cfdefaultcase タグ本文のコンテンツが実行されるのは、cfswitch タグの expression 属性が、cfswitch タグ本文の中にある cfcase タグで指定されたどの値にも一致しない場合だけです。cfdefaultcase タグ本文のコンテンツには、HTML およびテキストと、CFML のタグ、関数、変数、および式を含めることができます。
</p>

<p>
cfdefaultcase タグは、cfswitch タグ内に 1 つしか指定できません。cfdefaultcase タグは cfswitch ステートメント内の任意の場所に配置できます。最後の項目にする必要はありませんが、最後に配置するのが慣例になっています。
</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;!--- この例では、1 ～ 10 の得点に応じて等級を表示します。
      いくつかの cfcase タグは複数の得点に一致します。
      わかりやすくするため、ここでは得点を 7 に設定しています。 ---&gt;
&lt;cfset score=&quot;7&quot;&gt;
&lt;cfswitch expression=&quot;#score#&quot;&gt;
   &lt;cfcase value=&quot;10&quot;&gt;
      &lt;cfset grade=&quot;A&quot;&gt;
   &lt;/cfcase&gt;
   &lt;cfcase value=&quot;9;8&quot; delimiters=&quot;;&quot;&gt;
      &lt;cfset grade=&quot;B&quot;&gt;
   &lt;/cfcase&gt;
   &lt;cfcase value=&quot;7;6&quot; delimiters=&quot;;&quot;&gt;
      &lt;cfset grade=&quot;C&quot;&gt;
   &lt;/cfcase&gt;
   &lt;cfcase value=&quot;5;4;&quot; delimiters=&quot;;&quot;&gt;
      &lt;cfset grade=&quot;D&quot;&gt;
   &lt;/cfcase&gt;
   &lt;cfdefaultcase&gt;
      &lt;cfset grade=&quot;F&quot;&gt;
   &lt;/cfdefaultcase&gt;
&lt;/cfswitch&gt;
&lt;cfoutput&gt;
   あなたの等級は #grade# です。
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>

  </body>
</html>
