PowerTools SPREAD for Windows Forms 8.0J
UnparseFormula メソッド (IExpressionSupport2)


セルの行インデックス
セルの列インデックス
文字列に戻す式
指定した行および列のセルの指定した式に対する数式を文字列値として取得します。
構文
'Declaration
 
Function UnparseFormula( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal expression As Expression _
) As String
'使用法
 
Dim instance As IExpressionSupport2
Dim row As Integer
Dim column As Integer
Dim expression As Expression
Dim value As String
 
value = instance.UnparseFormula(row, column, expression)
string UnparseFormula( 
   int row,
   int column,
   Expression expression
)

パラメータ

row
セルの行インデックス
column
セルの列インデックス
expression
文字列に戻す式

戻り値の型

数式を含む String
次のサンプルコードは、式を評価し、指定した行および列のセルに対する結果のオブジェクトを返します。
FarPoint.Win.Spread.Model.IExpressionSupport ems; 
ems = (FarPoint.Win.Spread.Model.IExpressionSupport)fpSpread1.ActiveSheet.Models.Data; 
fpSpread1.ActiveSheet.SetValue(0, 0, 5); 
fpSpread1.ActiveSheet.SetValue(1, 0, 5); 
ems.SetFormula(2, 0, "SUM(A1, A2)"); 
string s;
s = ems.GetFormula(2, 0);
FarPoint.CalcEngine.Expression exp;
FarPoint.Win.Spread.Model.IExpressionSupport2 es;
es = (FarPoint.Win.Spread.Model.IExpressionSupport2)fpSpread1.ActiveSheet.Models.Data;
exp = es.ParseFormula(2, 0, s);
MessageBox.Show("The parsed formula is " + exp.ToString());
string ret;
ret = es.UnparseFormula(2, 0, exp);
MessageBox.Show("The unparsed formula is " + ret);
Dim ems As FarPoint.Win.Spread.Model.IExpressionSupport
ems = FpSpread1.ActiveSheet.Models.Data
FpSpread1.ActiveSheet.SetValue(0, 0, 5)
FpSpread1.ActiveSheet.SetValue(1, 0, 5)
ems.SetFormula(2, 0, "SUM(A1, A2)")
Dim s As String
s = ems.GetFormula(2, 0)
Dim exp As FarPoint.CalcEngine.Expression
Dim es As FarPoint.Win.Spread.Model.IExpressionSupport2
es = FpSpread1.ActiveSheet.Models.Data
exp = es.ParseFormula(2, 0, s)
Response.Write("The parsed formula is " & exp.ToString())
Dim ret As String
ret = es.UnparseFormula(2, 0, exp)
MessageBox.Show("The unparsed formula is " & ret)
参照

IExpressionSupport2 インタフェース
IExpressionSupport2 メンバ

 

 


© 2004-2015, GrapeCity inc. All rights reserved.