<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ARRAYAVG</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">ARRAYAVG</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>
Cӂ̔zɂl̕ςvZ܂B 
</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">߂l</span>
<p>
lBarray p[^l̔z̏ꍇ̓[Ԃ܂B 
</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">JeS</span>
<p>
z֐AZp֐
</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">֐̃V^bNX</span><pre>ArrayAvg(array)
</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">֘A</span>
<p>
ArraySumAwColdFusion MX JKChx̑5͂́uzƍ\̂̎gpv ́u{IȔzeNjbNv
</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">p[^</span>
<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">gp@</span>
<p>
̗ł́AtH[̃ANVy[WŎgp\ ColdFusion ̃rgCϐ Form.fieldNames gp܂B̕ϐɂ́AtH[̃tB[h̖ÕJ}؂胊Xg܂܂܂B 
</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;!--- ̗́AArrayAvg ̎gp@Ă܂B ---&gt;
&lt;!-- ̃R[hśAʏɃ_Ci~bNɐ
tH[tB[hj^܂BFieldnames ϐ ListLen ֐ƋɎgpāA
tH[̃tB[h̐߂܂B ---&gt;
&lt;cfset FormElem = 2&gt;
   &lt;cfif Isdefined(&quot;Form.Submit&quot;)&gt;
      &lt;cfif Form.Submit is &quot;More&quot;&gt;
         &lt;cfset FormElem = ListLen(Form.Fieldnames)&gt;
      &lt;/cfif&gt;
   &lt;/cfif&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;ArrayAvg ̗&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h3&gt;ArrayAvg ̗&lt;/h3&gt;
&lt;p&gt; ̗ł́AArrayAvg gpāAzɓ͂l̕ς߂܂B&lt;br&gt;
l 3 ȏ͂ɂ́A&lt;b&gt;[more]&lt;/b&gt; {^܂B
&lt;/p&gt;
&lt;form action = &quot;arrayavg.cfm&quot;&gt;
&lt;!--- ̃R[h́Aŏ 2 ̃tB[h쐬܂B[more] {^ƁAtB[hǉ
܂BFormElem ́ÃR[h̐擪 2 ɏAtH[ 2 ̃tB[h܂܂邱Ƃ
܂B -----&gt;
&lt;input type = &quot;submit&quot; name = &quot;submit&quot; value = &quot;more&quot;&gt;
&lt;table cellspacing = &quot;2&quot; cellpadding = &quot;2&quot; border = &quot;0&quot;&gt;
&lt;cfloop index = &quot;LoopItem&quot; from = &quot;1&quot; to = &quot;#FormElem#&quot;&gt;
   &lt;tr&gt;
      &lt;cfoutput&gt;
        &lt;th align = &quot;left&quot;&gt;Number #LoopItem#&lt;/th&gt;
        &lt;td&gt;&lt;input type = &quot;text&quot; name = &quot;number#LoopItem#&quot;&gt;&lt;/td&gt;
      &lt;/cfoutput&gt;
   &lt;/tr&gt;
&lt;/cfloop&gt;
&lt;/table&gt;
&lt;input type = &quot;submit&quot; name = &quot;submit&quot; value = &quot;ς擾&quot;&gt;
&lt;/form&gt;

&lt;!--- z쐬 ---&gt;
&lt;cfif IsDefined(&quot;FORM.submit&quot;)&gt;
   &lt;cfset myNumberArray = ArrayNew(1)&gt;
   &lt;cfset Count = 1&gt;
   &lt;cfloop index = &quot;ListItem&quot; list = &quot;#Form.Fieldnames#&quot;&gt;
       &lt;cfif Left(ListItem,3) is &quot;Num&quot;&gt;
         &lt;cfset myNumberArray[Count] = Val(&quot;number#Count#&quot;)&gt;
         &lt;cfset count = IncrementValue(Count)&gt;
      &lt;/cfif&gt; 
   &lt;/cfloop&gt;
      
   &lt;cfif Form.Submit is &quot;get the average&quot;&gt;   
      &lt;!--- ArrayAvg gpāA2 ̒l̕ς߂ ---&gt;
      &lt;p&gt;͂l̕ς́A
      &lt;cfoutput&gt;#ArrayAvg(myNumberArray)# łB&lt;/cfoutput&gt;
   &lt;cfelse&gt;
      &lt;cfoutput&gt;xsĂBȂƂ 2 ̐l͂Kv܂B
      &lt;/cfoutput&gt;
   &lt;/cfif&gt;   
&lt;/cfif&gt;   
&lt;/body&gt;
&lt;/html&gt; 
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ARRAY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ARRAY</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>z̖OłB


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

  </body>
</html>
