[Lazarus] ask for help

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jun 10 11:12:04 CEST 2013


On Mon, 10 Jun 2013 11:03:35 +0200
"Ryszard Michoński" <ryszard.michonski at gmail.com> wrote:

> Hello,
> 
> I am trying to move a simple database program from Delphi to Lazarus and 
> I have met the problem in below listed procedure which created no 
> problems in Delphi
> 
> 
> procedure TFormaGl.Lanos1Click(Sender: TObject);
> begin
>     WYDATKITytulem.AsString:='Zakupy';
>     WYDATKIGrupa.AsString:='xxxx';
>     WYDATKINazwaSklepu.AsString:='Orlen Międzyzdroje';
>     WYDATKI.Post;
>     SZCZEGOLY.AfterInsert:=nil;
>     if not (SZCZEGOLY.State in [dsInsert, dsEdit]) then SZCZEGOLY.Insert;
>     SZCZEGOLYTowar.AsString:='Gaz Lanos';
>     SZCZEGOLYJm.AsString:='l';
>     SZCZEGOLYGrupa.AsString:='LanosG';
>     SZCZEGOLY.AfterInsert:=SZCZEGOLYAfterInsert;

That is only valid in mode Delphi.
For mode ObjFPC you need
     SZCZEGOLY.AfterInsert:=@SZCZEGOLYAfterInsert;


> end;
> 
> During compilation I am getting info about errors
> 
> u_gl.pas(166,47) Error: Wrong number of parameters specified for call to 
> "SZCZEGOLYAfterInsert"
> u_gl.pas(117,15) Hint: Found declaration: 
> TFormaGl.SZCZEGOLYAfterInsert(TDataSet);
> 
> Can I count for any hint ?

Mattias




More information about the Lazarus mailing list