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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to link a procedure from one unit to another?

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I'm trying to clean up my code. I have a form that has an onlick event for a Tedit. The thing is that the procedure for the onclick event is in another unit (with no form).
I moved the declaration of this procedure into the main form unit like that it shows in the pull down option of the onclick event.
The thing is it cannot find the procedure that is located in the other unit. Ihave the use statement pointing to the other unit, but it still tells me that is is unsatisfied. I know i can move back the code to my main unit but would like not to.
How do i do that?
Thanks.
PO
 
Did you remember to define a forward for the procedure in the interface section of the unit?
 
Nope, do i just add forward at the end of the procedure? Let me look in the manual.
Thanks.
PO
 
Usually it's just restating the main calling part of the procedure.

Code:
unit test;
  interface
     procedure mytestproc;
  implementation
     procedure mytestproc;
       begin
         writeln('Hello from my test proc.');
       end;
  end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top