Solved

.DEF file problems...

Posted on 1998-03-17
1
131 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…

856 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