TIfOperation class
Internally used class for conditional if-then-else operations
Declaration
TIfOperation = class(TFPBinaryOperation)Inheritance
- TIfOperation
- TFPBinaryOperation
- TFPExprNode
- TObject
Description
The TIfOperation class implements conditional if-then-else operations in expressions, allowing for branching logic based on boolean conditions.
It extends the expression framework to provide conditional evaluation similar to the ternary operator in many programming languages.
The operation evaluates a boolean condition and returns one of two expressions based on the result: the "then" expression if the condition is True, or the "else" expression if the condition is False. This enables complex conditional logic within expressions.
The class manages three operands: the condition (which must evaluate to boolean), the "then" expression (evaluated when condition is True), and the "else" expression (evaluated when condition is False). Only one of the result expressions is evaluated, providing efficient conditional processing.
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 if operation |
Methods
GetNodeValue | protected | |
Check | public | Validate the conditional operation for correctness |
InitAggregate | public | Initialize aggregate processing for if operation |
UpdateAggregate | public | Update aggregate calculations for if operation |
HasAggregate | public | Check if conditional operation contains aggregates |
NodeType | public | Get the result type for conditional operation |
Create | public | Create conditional operation with condition and branches |
destroy | public | Destroy conditional operation and free resources |
AsString | public | Get string representation of conditional operation |
Inherited
From TFPBinaryOperation (3)
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.
