Spread ASP.NET 6.0 Product Documentation
ArrayExpression Constructor
See Also  Example Send Feedback
FarPoint.CalcEngine Assembly > FarPoint.CalcEngine Namespace > ArrayExpression Class : ArrayExpression Constructor


values
Array of constant values

Glossary Item Box

Creates an expression with an array of constant values.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal values(,) As Object _
)
Visual Basic (Usage)Copy Code
Dim values() As Object
 
Dim instance As New ArrayExpression(values)
C# 
public ArrayExpression( 
   object[,] values
)

Parameters

values
Array of constant values

Exceptions

ExceptionDescription
System.ArgumentNullExceptionvalues is a null reference (Nothing in Visual Basic)

Example

This example creates an expression with an array of constant values.
C#Copy Code
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.Expression arg1 = new FarPoint.CalcEngine.ArrayExpression(knownY);
FarPoint.CalcEngine.Expression arg2 = new FarPoint.CalcEngine.ArrayExpression(knownX);
FarPoint.CalcEngine.Expression[] args = new FarPoint.CalcEngine.Expression[] {arg1, arg2};
FarPoint.CalcEngine.Expression func = new FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.SlopeFunction,args);
//Spread for Windows Forms
((FarPoint.Win.Spread.Model.IExpressionSupport)fpSpread1.ActiveSheet.Models.Data).SetExpression(0, 0, func);
//Spread for Web Forms
((FarPoint.Web.Spread.Model.IExpressionSupport)FpSpread1.Sheets[0].DataModel).SetExpression(0, 0, func);
Visual BasicCopy Code
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)
'Spread for Web Forms
CType(FpSpread1.Sheets(0).DataModel, FarPoint.Web.Spread.Model.IExpressionSupport).SetExpression(0, 0, func)

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.