[Lazarus] weird error message

duilio foschi octopushole at gmail.com
Fri Aug 21 17:46:53 CEST 2020


1.
when the compiler reaches this line,,,

qryMain.AfterOpen:=TB_DPTAfterOpen;

it throws the error:
unit1.pas(190,23) Error: Wrong number of parameters specified for call
to "TB_DPTAfterOpen"

2.
TB_DPTAfterOpen is declared as:

TFrame1=class(TFrame)
protected
              procedure TB_DPTAfterOpen(DataSet: TDataSet);
...

3.
qryMain is declared as:

qryMain: TSQLQuery;

4.
AfterOpen is a  TDataSetNotifyEvent

AfterOpen: TDataSetNotifyEvent

5.
TDataSetNotifyEvent is declared as

TDataSetNotifyEvent = procedure(DataSet: TDataSet) of object;

Ev seems ok to me. So where is the error?

Thank you

Peppe Polpo


More information about the lazarus mailing list