FireDAC.Comp.DataSet.TFDAggregate.InUse

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDAggregate

Delphi

property InUse: Boolean read GetInUse;

C++

__property bool InUse = {read=GetInUse, nodefault};

Description

Indicates whether the aggregated value is currently available.

Read InUse to determine whether the Value property returns an aggregated value. 

When InUse is False, Value is not accessible and it returns null.  When InUse is True, the aggregated value is maintained. So it calculates the formula specified by Expression for the current set of records, including any edits to the records in the current group. The value is accessible and Value returns a meaningful value.

Example

if FDQuery1.Aggregates[0].InUse then
  Label1.Caption := VarToStr(FDQuery1.Aggregates[0].Value)
else
  Label1.Caption := '<not accessible>';

See Also