<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>CFCASE</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">CFCASE</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 タグ内に指定された式が特定の値を取るときに実行されるコードを含みます。 
</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;cfcase
   value = &quot;value or delimited set of values&quot;
   delimiters = &quot;delimiter characters&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>
cfdefaultcase、cfswitch、『ColdFusion MX 開発ガイド』の第2章の「CFML の要素」 の「cfswitch、cfcase、および cfdefaultcase」
</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>
cfcase タグ本文のコンテンツが実行されるのは、cfswitch タグの expression 属性の評価結果がこのタグの value 属性に指定した値を評価するときだけです。cfcase タグ本文のコンテンツには、HTML およびテキストと、CFML のタグ、関数、変数、および式を含めることができます。一部の言語とは異なり、cfcase タグを明示的に終了させる必要はありません。
</p>

<p>
1 つの cfcase タグを複数の expression 値に一致させることもできます。そのためには、一致させる値を区切り文字 (デフォルトはカンマ) で区切ります。たとえば、次の行は &quot;red&quot;、&quot;blue&quot;、または &quot;green&quot; に一致させます。
</p>
<pre>&lt;cfcase value=&quot;red,blue,green&quot;&gt;
</pre>
<p>
delimiter 属性を使用すれば、カンマの代わりに使う区切り文字を指定することができます。たとえば、次の行は &quot;cargo, live&quot;、&quot;cargo, liquid&quot;、&quot;cargo, solid&quot; に一致させます。
</p>
<pre>&lt;cfcase value=&quot;cargo, live;cargo, liquid-cargo, solid&quot; delimiters=&quot;;-&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>
この例では、1 ～ 10 の得点に応じて等級を表示します。複数の cfcase タグは複数の得点に一致します。わかりやすくするため、ここでは得点を 7 に設定しています。
</p>
<pre>&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>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</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>cfswitch タグの expression 属性と一致させる必要のある値を指定します。一致させる値を複数指定するときは、個々の値を delimiter 属性の文字で区切ります。指定する値は、単純な定数か、定数式でなければなりません。変数は指定できません。</p>

  </td>
  </tr>
  </table>
</div>
<div id="DELIMITER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DELIMITER</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> ", (カンマ)"


<p>一致させる複数の値を区切るための区切り文字です。複数の区切り文字を指定した場合は、値を区切るときにどの文字を使ってもかまいません。</p>

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

  </body>
</html>
