次の方法で共有


IPMath.Avg メソッド

ノード セットに含まれるすべての数値要素の平均値を取得します。

このメソッドは、CLS に準拠していません。  

名前空間: Microsoft.Office.Interop.InfoPath.SemiTrust
アセンブリ: Microsoft.Office.Interop.InfoPath.SemiTrust (microsoft.office.interop.infopath.semitrust.dll 内)

構文

'宣言
<DispIdAttribute(1)> _
Function Avg ( _
    pxmllistInput As IXMLDOMNodeList _
) As Object
'使用
Dim instance As IPMath
Dim pxmllistInput As IXMLDOMNodeList
Dim returnValue As Object

returnValue = instance.Avg(pxmllistInput)
[DispIdAttribute(1)] 
Object Avg (
    IXMLDOMNodeList pxmllistInput
)

パラメータ

  • pxmllistInput
    平均する値が含まれているノード セット。

戻り値

ノード セットに含まれるすべての数値要素の平均値を表すオブジェクト。

コメント

メモ重要 :

このメンバは制限なしでアクセスできます。

次の例では、変数 averageAge に my:ages ノード セットに含まれるすべての数値要素の平均値を設定しています。my:ages は、繰り返しセクションまたはテーブル内にある簡単なフィールドです。

IXMLDOMNodeList ages = thisXDocument.DOM.selectNodes("//my:ages");
   object averageAge = thisXDocument.Util.Math.Avg(ages);
   thisXDocument.UI.Alert(averageAge.ToString());

関連項目

参照

IPMath インターフェイス
IPMath のメンバ
Microsoft.Office.Interop.InfoPath.SemiTrust 名前空間