Spread for ASP.NET 8.0 Product Documentation
ErrorExpression Constructor
Example 


Error value
Creates a new expression with an error constant value.
Syntax
'Declaration
 
Public Function New( _
   ByVal value As CalcError _
)
'Usage
 
Dim value As CalcError
 
Dim instance As New ErrorExpression(value)
public ErrorExpression( 
   CalcError value
)

Parameters

value
Error value
Exceptions
ExceptionDescription
System.ArgumentNullExceptionvalue is a null reference (Nothing in Visual Basic)
Example
This example returns the error.
FarPoint.CalcEngine.ErrorExpression expr = new FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.NotAvailable);
FarPoint.CalcEngine.Expression[] args = {expr};
FarPoint.CalcEngine.FunctionExpression func = new FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.IsErrorFunction,
args);
//Spread for Windows Forms
((FarPoint.Win.Spread.Model.IExpressionSupport)(fpSpread1.ActiveSheet.Models.Data)).SetExpression(0, 0, func);
MessageBox.Show(FarPoint.CalcEngine.CalcError.Name.ToString());
//Spread for Web Forms
((FarPoint.Web.Spread.Model.IExpressionSupport)(FpSpread1.Sheets[0].DataModel)).SetExpression(0, 0, func);
TextBox1.Text = FarPoint.CalcEngine.CalcError.Name.ToString();
Dim expr As New FarPoint.CalcEngine.ErrorExpression(FarPoint.CalcEngine.CalcError.NotAvailable)
Dim args() As FarPoint.CalcEngine.Expression = {expr}
Dim func As New FarPoint.CalcEngine.FunctionExpression(FarPoint.CalcEngine.FunctionInfo.IsErrorFunction, args)
'Spread for Windows Forms
CType(FpSpread1.ActiveSheet.Models.Data, FarPoint.Win.Spread.Model.IExpressionSupport).SetExpression(0, 0, func)
MessageBox.Show(expr.ErrorValue.Name.ToString)
'Spread for Web Forms
CType(FpSpread1.Sheets(0).DataModel, FarPoint.Web.Spread.Model.IExpressionSupport).SetExpression(0, 0, func)
TextBox1.Text = expr.ErrorValue.Name.ToString()
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

ErrorExpression Class
ErrorExpression Members

 

 


Copyright © GrapeCity, inc. All rights reserved.