Delphi units

I have some functions that I want to put them in seperate unit and use them in other units.
How can I create this unit?
Who is Participating?
ThievingSixConnect With a Mentor Commented:
File --> New --> Unit

Put the function code underneath implementation and put the function header above like this:

function Add(x,y: Integer):Integer;


function Add(x,y: Integer):Integer;
  Result := x + y;

Also remember that new units have no uses declared so if your function uses some other units you have to declare them in the new units uses. Once you have your new unit done go back to the unit you want to use the new unit in and click File --> Use unit, and select your unit.
factsfaceAuthor Commented:
It works fine.
Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.