Subject | Re: [IBO] TIB_Cursor |
---|---|
Author | jwharton@ibobjects.com |
Post date | 2004-02-23T17:48:09Z |
> I have defined a field in CalculatedFields like:Let me refine Lucas's answer a bit if I may:
>
> MyFloat Numeric(15,2)
>
>
> But how do I assign a value OnCalculateFields ?
procedure TMyForm.MyCursorCalculateField(Sender: TIB_Statement;
ARow: TIB_Row; AField: TIB_Column);
begin
if aField.Fieldname = 'MYFLOAT' then // is it the calcfield?
begin
aRow.ByName ( 'MYFLOAT' ).AsDouble :=
aRowByName ( 'RADIUS' ).AsDouble * 3.141592654;
end;
end;
Both references need to be using aRow.ByName and not FieldByName.
Regards,
Jason Wharton