Subject Re: [IBO] Example of CalculateFields !
Author Andreas Hesse
mmusetti70 schrieb:
> Hi, in my table I have a field DATE. How do the difference between the current date and the field DATA using CalculateFields ?
>
> Thanks,
>
> Marcos
>
>

Here is an example of a OnCalculate - Event:

procedure TdmVorgang.dataAdresseCalculateField(Sender: TIB_Statement;
ARow: TIB_Row; AField: TIB_Column);
begin
if SameText(AField.FieldName, 'Adresszeile') then
AField.AsString := CreateAdresszeile(ARow)
else if SameText(AField.FieldName, 'Anschrift') then
AField.AsString := CreateAnschrift(ARow);
end;

Important:
The Event Parameters gives you all, you need
- use the row of the event (it is not always the same as your Query.Row
- use the field of the event
(attention: it may be null, depends on property CalculateAllFields)

--
Andreas