Board index » delphi » Sender: TObject???

Sender: TObject???

Why is it that if I don't include 'Sender:Tobject' as the first
parameter in any procedure / function, I get errors?

What if I don't want to pass anything to a procedure?

HELP!

 

Re:Sender: TObject???


That doesn't make much sense. The Events have Sender:TObject, because
the code needs to know which control caused the event to trigger, but
procedures you write have whatever parameters you want to give them,
if any.

procedure TestProcedure;
procedure AnotherTest(  value : String );

procedure TestProcedure;
Begin

End;

procedure AnotherTest( value : String );
Begin

End;

Quote
On Tue, 19 Dec 1995 05:02:44 GMT, dyu...@terminus.com (Stone) wrote:
>Why is it that if I don't include 'Sender:Tobject' as the first
>parameter in any procedure / function, I get errors?

>What if I don't want to pass anything to a procedure?

>HELP!

---------------------------------
Casey Charlton
ca...@larouss.demon.co.uk

Re:Sender: TObject???


Quote
Stone (dyu...@terminus.com) wrote:

: Why is it that if I don't include 'Sender:Tobject' as the first
: parameter in any procedure / function, I get errors?

: What if I don't want to pass anything to a procedure?

: HELP!

Only if the procedure is supposed to be called as an event-handler of a
component. The following works fine:

Procedure Foo;
Begin
  DoSomeStuff;
End;

  /Johan...!

Re:Sender: TObject???


So I only need ...(Sender: TObject) if the procedure is an Event
handler?  AHHHHH!  That has to be it.  

When I removed this with my own code, it worked!

Thanks!

Other Threads