RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TField.Calculated Property

Determines whether the value of the field is calculated by the OnCalcFields event handler of its dataset.

Pascal
property Calculated: Boolean;
C++
__property Boolean Calculated;

Use Calculated to determine if the field is a calculated field. When Calculated is true and the OnCalcFields event occurs, the OnCalcFields event handler updates the value of the field. The default value is false. 

The value of a Calculated field is not stored in or retrieved from the physical tables underlying a dataset. Instead, calculated fields are calculated for each record in the table by the dataset's OnCalcFields event handler, which typically uses expressions involving values from other fields in the record to generate a value for each calculated field.  

For example, a dataset might have non-calculated fields for Quantity and UnitPrice, and a calculated field for ExtendedPrice, which would be calculated by multiplying the values of the Quantity and UnitPrice fields in an OnCalcFields event handler.

Note: Do not change the setting of Calculated in application code. Calculated is automatically set to true by the Fields editor at design time if a field's value is specified as calculated.
Note: Do not confuse the Calculated property with the InternalCalcField property of a field definition. The value of a calculated field is computed in the OnCalcFields event handler. The value of an internally calculated field is computed by the SQL server or the Borland Database Engine
.  

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!