Solved

.DEF file problems...

Posted on 1998-03-17
1
130 Views
Last Modified: 2010-04-06
Hi,
   I want to write a unit which just contains procedures which can be used by the Main unit. I've tried doing this, but I don't know how to write a definition file for it. It doesn't contain any objects or attributes, just a list of procedures. Can anyone tell me how to do this?
Cheers.
0
Comment
Question by:PiersBull
1 Comment
 
LVL 4

Accepted Solution

by:
d003303 earned 10 total points
ID: 1360527
Where should the code of the procedures resist ? In an external DLL or in the definition file ?
The interface part of any unit is a kind of definition file. It defines the interfaces of the unit. The implementation part contains the code of the interfaces or their adress in external libraries.
e.g.

// to be MyProcs.pas
unit MyProcs

interface

function TimesTwo(AValue : Integer): Integer;

implementation

function TimesTwo(AValue : Integer): Integer;
begin
  Result := AValue * 2;
end;

end.
// **

Just put MyProcs.pas in your link path, include MyProcs into the uses clause of the main unit and that's it.


Slash/d003303
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question