Spread Windows Forms 8.0 Product Documentation
ArrayValue Property
Example 


Gets the array value as a CalcArray object.
Syntax
'Declaration
 
Public ReadOnly Property ArrayValue As CalcArray
'Usage
 
Dim instance As ArrayExpression
Dim value As CalcArray
 
value = instance.ArrayValue
public CalcArray ArrayValue {get;}

Property Value

CalcArray object containing an array of constants
Example
This example returns the array value as a CalcArray.
//Spread for Windows Forms
object[,] knownY = {{2.0, 3.0, 9.0, 1.0, 8.0, 7.0, 5.0}};
object[,] knownX = {{6.0, 5.0, 11.0, 7.0, 5.0, 4.0, 4.0}};
FarPoint.CalcEngine.ArrayExpression arg1 = new FarPoint.CalcEngine.ArrayExpression(knownY);
FarPoint.CalcEngine.ArrayExpression arg2 = new FarPoint.CalcEngine.ArrayExpression(knownX);
FarPoint.CalcEngine.Expression[] args = {arg1, arg2};
FarPoint.CalcEngine.Expression func = new FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.SlopeFunction,args);
((FarPoint.Win.Spread.Model.IExpressionSupport)fpSpread1.ActiveSheet.Models.Data).SetExpression(0, 0, func);
FarPoint.CalcEngine.CalcArray ca = arg1.ArrayValue;
MessageBox.Show(ca.GetValue(0,0).ToString());
//Spread for Web Forms
object[,] knownY = {{2.0, 3.0, 9.0, 1.0, 8.0, 7.0, 5.0}};
object[,] knownX = {{6.0, 5.0, 11.0, 7.0, 5.0, 4.0, 4.0}};
FarPoint.CalcEngine.ArrayExpression arg1 = new FarPoint.CalcEngine.ArrayExpression(knownY);
FarPoint.CalcEngine.ArrayExpression arg2 = new FarPoint.CalcEngine.ArrayExpression(knownX);
FarPoint.CalcEngine.Expression[] args = {arg1, arg2};
FarPoint.CalcEngine.FunctionExpression func = new FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.SlopeFunction,
args);
((FarPoint.Web.Spread.Model.IExpressionSupport)FpSpread1.ActiveSheetView.DataModel).SetExpression(0, 0, func);
FarPoint.CalcEngine.CalcArray ca = arg1.ArrayValue;
string msg = "The value of the calc array is " + ca.GetValue(0, 0).ToString();
Dim x As Object(,) = {{2.0, 3.0, 9.0, 1.0, 8.0, 7.0, 5.0}}
Dim y As Object(,) = {{6.0, 5.0, 11.0, 7.0, 5.0, 4.0, 4.0}}
Dim arg1 As New FarPoint.CalcEngine.ArrayExpression(x)
Dim arg2 As New FarPoint.CalcEngine.ArrayExpression(y)
Dim args() As FarPoint.CalcEngine.Expression = {arg1, arg2}
Dim func As New FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.SlopeFunction, args)
'Spread for Windows Forms
CType(FpSpread1.ActiveSheet.Models.Data, FarPoint.Win.Spread.Model.IExpressionSupport).SetExpression(0, 0, func)
Dim ca As FarPoint.CalcEngine.CalcArray = arg1.ArrayValue
MsgBox(ca.GetValue(0, 0))
'Spread for Web Forms
CType(FpSpread1.Sheets(0).DataModel, FarPoint.Web.Spread.Model.IExpressionSupport).SetExpression(0, 0, func)
Dim ca As FarPoint.CalcEngine.CalcArray = arg1.ArrayValue
TextBox1.Text = arg1.Value.ToString()
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

ArrayExpression Class
ArrayExpression Members

 

 


Copyright © GrapeCity, inc. All rights reserved.