Skip to content

TAggregateSum.ConvertArgument

Convert argument for sum aggregation

Declaration

Source position: fpexprpars.pp line 678

public 
function TAggregateSum.ConvertArgument(aIndex: Integer; 
                                      aNode: TFPExprNode; 
                                      aType: TResultType) : TFPExprNode
                                      ;  override;

Description

The ConvertArgument method converts an expression node argument to an appropriate numeric type for summation. It handles type conversion between different numeric types to ensure compatibility during the sum calculation process.

The method takes the argument index, the expression node containing the value, and the target result type, then performs the necessary conversion to make the value compatible with the sum operation.

This conversion ensures that mixed numeric types can be properly summed together while maintaining appropriate precision and avoiding type-related runtime errors.