TCaseOperation class
Internally used class for case-when conditional operations
Declaration
TCaseOperation = class(TFPExprNode)Inheritance
- TCaseOperation
- TFPExprNode
- 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
Properties
Condition | public | The condition expression of the case operation |
Methods
GetNodeValue | protected | |
Check | public | Validate the case operation for correctness |
InitAggregate | public | Initialize aggregate processing for case operation |
UpdateAggregate | public | Update aggregate calculations for case operation |
HasAggregate | public | Check if case operation contains aggregates |
NodeType | public | Get the result type for case operation |
Create | public | Create case operation with arguments |
destroy | public | Destroy case operation and free resources |
AsString | public | Get string representation of case operation |
Inherited
From TFPExprNode (3)
From TObject (40)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
