Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing procedure as parameter

Status
Not open for further replies.

hilbrink

Programmer
Dec 8, 2000
38
0
0
NL
Hello,

Can anybody tell me how to execute a procedure that you pass as a parameter?
I have:

type DBproc = procedure();

procedure DBUpdateProcedure(a_procedure: DBproc);
begin
{statements}
a_procedure;
end;

procedure proc_a();
begin
{statements}
end;

Then I would like to execute proc_a like this:

DbUpdateProcedure(proc_a());

I can't compile this, the error I get is: Incompatible types: 'DBproc' and 'procedure, untyped pointer or untyped parameter'
I hope that anybody knows how to solve this.
Thanx in advance!
 
hi hilbrink,

one way is just doing like this:

...

procedure ExecuteIt;
var
a_procedure: DBproc;
begin
a_procedure := proc_a;
DbUpdateProcedure(a_procedure);
end;

regards
Roderich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top