Assign a procedure with a parameter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Assign a procedure with a parameter

Damian
Hi!

I am using uos_EndProc to assign the procedure of object to execute at end, after loop. And it works good.

But...

Can I assing the procedure with a certain PARAMETERS this way? When I try to assing, for example, TFrom1.SomeProc(someint: integer), i'm getting just this error:

Error: Incompatible type for arg no. 2: Got "<procedure variable type of procedure(LongInt) of object;Register>", expected "<procedure variable type of procedure of object;Register>"


Reply | Threaded
Open this post in threaded view
|

Re: Assign a procedure with a parameter

fredvs
Administrator
Hello.

Not sure to understand but you may use something like this:

procedure TFrom1.SomeProc(someint: integer);
  begin
  dosomething
  end;

 procedure TForm1.MyEndproc; // use this for endproc of uos
  begin
  SomeProc(someint);
 end;

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: Assign a procedure with a parameter

Damian
Hello.

Silly me, it's so simple!!!

Thanks for your answer!