Table of Contents

Struct EvalResult

Namespace
Hi.NcParsers.EvaluationSyntaxs.Evaluation
Assembly
HiMech.dll

Outcome of evaluating an NcExpr. Either a successful numeric value, or a failure with an error code matching the diagnostic catalogue used by reading / evaluator syntaxes.

public readonly record struct EvalResult : IEquatable<EvalResult>
Implements
Inherited Members
Extension Methods

Constructors

EvalResult(double?, string, string)

Outcome of evaluating an NcExpr. Either a successful numeric value, or a failure with an error code matching the diagnostic catalogue used by reading / evaluator syntaxes.

public EvalResult(double? Value, string ErrorCode, string ErrorMessage)

Parameters

Value double?
ErrorCode string
ErrorMessage string

Properties

ErrorCode

public string ErrorCode { get; init; }

Property Value

string

ErrorMessage

public string ErrorMessage { get; init; }

Property Value

string

IsSuccess

true when ErrorCode is null.

public bool IsSuccess { get; }

Property Value

bool

Value

public double? Value { get; init; }

Property Value

double?

Methods

Failure(string, string)

Failed evaluation with a diagnostic code and message.

public static EvalResult Failure(string errorCode, string errorMessage)

Parameters

errorCode string
errorMessage string

Returns

EvalResult

Success(double)

Successful evaluation.

public static EvalResult Success(double value)

Parameters

value double

Returns

EvalResult