Solved

.DEF file problems...

Posted on 1998-03-17
1
127 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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now