IFormulaCondition

Defines the public contract for the FormulaCondition class, exposing variable/condition accessors, dictionary-based validation, and methods for rendering Excel predicates used in analysis formulas.

DataAccess

Variables #

Retrieve a clone of the stored variable names

Signature:

Public Property Get Variables() As BetterArray: End Property

Read-only access to the stored variable and condition collections. Returns a BetterArray copy of the variable identifiers in the order they were supplied at creation.

Returns: BetterArray. The variable names preserving the original order.


Conditions #

Retrieve a clone of the stored condition fragments

Signature:

Public Property Get Conditions() As BetterArray: End Property

Returns a BetterArray copy of the predicate fragments in the order they were supplied at creation.

Returns: BetterArray. The condition fragments preserving the original order.


VariablesTable #

Resolve the table name shared by all tracked variables

Signature:

Public Property Get VariablesTable(ByVal dict As ILLdictionary) As String: End Property

Returns the memoised table name from a previous validation, or triggers a fresh validation pass against the supplied dictionary when no cached value exists.

Parameters:

  • dict: ILLdictionary. The dictionary used when validation has not occurred yet.

Returns: String. Table identifier or empty string when unavailable.


Validation

Valid #

Validate variable/condition lists against the dictionary

Signature:

Public Function Valid(ByVal dict As ILLdictionary, Optional ByVal tablename As String = vbNullString) As Boolean: End Function

Validation and predicate rendering operations. Implementations verify that all variables exist in the dictionary and belong to the same table. When a tablename is supplied it overrides the table resolved from the first variable.

Parameters:

  • dict: ILLdictionary. The metadata provider used for variable lookups.
  • tablename: Optional String. When supplied, forces the expected table name. Defaults to vbNullString.

Returns: Boolean. True when validation succeeds.


ConditionString #

Wrap the predicate in an IF expression referencing the supplied variable

Signature:

Public Function ConditionString(ByVal tablename As String, ByVal varName As String, _
                                Optional ByVal Connector As String = "*") As String

Joins all variable/condition pairs using ConditionPredicate and wraps the result in an IF function that returns the variable value when the predicate evaluates to True.

Parameters:

  • tablename: String. Structured reference table name.
  • varName: String. Variable/column name to return when the condition is met.
  • Connector: Optional String. Connector used between predicates. Defaults to "*".

Returns: String. An IF expression or empty string when the predicate is empty.


ConditionPredicate #

Join the variable predicates using the supplied connector

Signature:

Public Function ConditionPredicate(ByVal tablename As String, Optional ByVal Connector As String = "*") As String

Returns the joined predicate without the IF wrapper, useful when callers need the raw predicate for embedding in other constructs.

Parameters:

  • tablename: String. Structured reference table name.
  • Connector: Optional String. Connector between predicate fragments. Defaults to "*".

Returns: String. Concatenated predicate or empty string when inputs are missing.


Diagnostics

HasCheckings #

Determine whether validation recorded diagnostic messages

Signature:

Public Function HasCheckings() As Boolean

Exposure of validation traces for diagnostics. Returns True when at least one diagnostic entry was captured during the last validation run.

Returns: Boolean. True when internal checks exist.


CheckingValues #

Retrieve the internal checking log

Signature:

Public Property Get CheckingValues() As IChecking

Returns the accumulated IChecking instance containing all diagnostic messages from the last validation run, or Nothing when no diagnostics were recorded.

Returns: IChecking. The diagnostic log.