On Tue, 1 Jan 2013 11:54:43 -0800 (PST)
Alejandro Gonzalo <[email protected]> wrote:
> Try this:
> In the interface part of the form unit insert this prototype into the Private
> declarations:
>
> private
> { Private declarations }
> Procedure OnCalcFields(DataSet: TDataSet); // insert this
>
> Early in the implementation part insert the event procedure:
>
> Procedure TForm1.OnCalcFields(DataSet: TDataSet);
> begin
> SQLQuery1.FieldByName('calc').AsBoolean := true;
> end;
>
> Then after creating your "f" field:
> f.DataSet := SQLQuery1.FieldDefs.Dataset;
> SQLQuery1.OnCalcFields:=OnCalcFields; // insert this line
> Dealing with events without using the Object Inspector can be tricky!
Hint:
You can write
SQLQuery1.OnCalcFields:=|
Then press Shift+Ctrl+C (Code completion) and the OnCalcFields will be
created automatically.
Mattias
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus