Subject Re: [IBO] TIB_Cursor
Author jwharton@ibobjects.com
> I have defined a field in CalculatedFields like:
>
> MyFloat Numeric(15,2)
>
>
> But how do I assign a value OnCalculateFields ?

Let me refine Lucas's answer a bit if I may:

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