Page 1 of 1

Using other written functions in a unit

PostPosted: May 31st, 2007, 10:11 pm
by Wardlow
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

PostPosted: May 31st, 2007, 10:21 pm
by Kambiz
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.

PostPosted: May 31st, 2007, 10:44 pm
by Wardlow
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

PostPosted: June 1st, 2007, 1:41 am
by Kambiz
Seems the problem is something else.

The uses clause must be after interface keyword.

PostPosted: June 1st, 2007, 5:07 am
by Christine123
that's exactly what the problem was. Thank you very much for helping me