Unit 'fpexprpars' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#fcl]

TCaseOperation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Internally used class for case-when conditional operations

Declaration

Source position: fpexprpars.pp line 279

type TCaseOperation = class(TFPExprNode)

public

  procedure Check; override;

  

Validate the case operation for correctness

  procedure InitAggregate; override;

  

Initialize aggregate processing for case operation

  procedure UpdateAggregate; override;

  

Update aggregate calculations for case operation

  function HasAggregate; override;

  

Check if case operation contains aggregates

  function NodeType; override;

  

Get the result type for case operation

  constructor Create();

  

Create case operation with arguments

  destructor destroy; override;

  

Destroy case operation and free resources

  function AsString; override;

  

Get string representation of case operation

  property Condition: TFPExprNode; [r]

  

The condition expression of the case operation

end;

Inheritance

TCaseOperation

  

Internally used class for case-when conditional operations

|

TFPExprNode

  

Class for representing nodes in expression trees

|

TObject

Description

The TCaseOperation class implements case-when conditional operations in expressions, providing multi-way branching logic based on value matching. It allows for testing a single expression against multiple possible values and executing different branches based on which value matches.

The case operation evaluates a test expression and compares it against a series of when-value pairs, executing the associated expression for the first matching value. If no values match, an optional else expression is evaluated.

The TCaseOperation class enables complex multi-conditional logic within expressions, similar to CASE statements in SQL or switch statements in programming languages, providing an alternative to nested if-then-else constructs.

This class is used internally by the TFPExpressionParser class to construct an AST (Abstract Syntax Tree). There is normally no need for you to use or instantiate this class directly.

See also

TFPExprNode

  

Class for representing nodes in expression trees


Documentation generated on: Dec 15 2025