Board index » delphi » how to call a Sender: TObject procedure in a OnUpdateRecord procedure?

how to call a Sender: TObject procedure in a OnUpdateRecord procedure?

I have written a procedure with some code:

procedure TmainForm.MailingListAlert(Sender: TObject);
...
...

And I have also made a the OnUpdateRecord procedure:

procedure TDataModule1.KlantenInfoTableUpdateRecord(DataSet: TDataSet;
  UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
...
...
...

Now, when I try to call the first procedure in the second one like this:

procedure TDataModule1.KlantenInfoTableUpdateRecord(DataSet: TDataSet;
  UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
begin
  MailingListAlert(Sender);
end;

The compiler sais: Undeclared identifier: 'Sender'.  Is there a way to make
this work?

thanks on advance

 

Re:how to call a Sender: TObject procedure in a OnUpdateRecord procedure?


You need to pass a valid TObject.  Sender is just the name given that object
within the called event.  If you don't use the Sender parameter for anything
inside MailingListAlert, then just pass nil.  Otherwise, pass the object
which your MailingListAlert nees, such as the MainForm or Self (the
TDataModule1 instance).
-Howard Moon

Re:how to call a Sender: TObject procedure in a OnUpdateRecord procedure?


Oops! That's "needs", not "nees" in the message below. Sorry.
-Howard

Quote
Howard Moon wrote in message <7k5ips$k...@forums.borland.com>...
>You need to pass a valid TObject.  Sender is just the name given that
object
>within the called event.  If you don't use the Sender parameter for
anything
>inside MailingListAlert, then just pass nil.  Otherwise, pass the object
>which your MailingListAlert nees, such as the MainForm or Self (the
>TDataModule1 instance).
>-Howard Moon

Other Threads