## Using other written functions in a unit

Please discuss general Delphi programming topics here.

### Using other written functions in a unit

I created a unit to store functions. However within the unit where I create the fucntion. I would like to use other functions in other units, to help create my function. I tried to write ...
Code: Select all
 Uses // wherever my function is located 

However, it doesn't work
Suggestions?

Ty
Wardlow
Junior Member

Posts: 38
Joined: May 31st, 2007, 10:08 pm

In the uses clause, you must include only the unit names. However, the location of referenced units should be in Delphi's search path. Go to Delphi's options and include path to your units there.
Kambiz

Kambiz

Posts: 2428
Joined: March 7th, 2003, 7:10 pm

Kambiz,

Thank you for your reply. StrUtils is the location where the function I need is. My function works in the main program if I write "uses strUtils" So in the unit I am creating I write...
Code: Select all
 uses   StrUtils; unit TextFunctions; interface // functions 

.. so are you saying I should go to options and tell it to look for "StrUtils"??
... however I am getting an error
Wardlow
Junior Member

Posts: 38
Joined: May 31st, 2007, 10:08 pm

Seems the problem is something else.

The uses clause must be after interface keyword.
Kambiz

Kambiz

Posts: 2428
Joined: March 7th, 2003, 7:10 pm

that's exactly what the problem was. Thank you very much for helping me
Christine123
Junior Member

Posts: 25
Joined: May 28th, 2007, 10:28 pm