Solved

.DEF file problems...

Posted on 1998-03-17
1
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 124
Convert a string into a TDateTime 5 73
control image tags in a string ? 12 154
Delphi Yen format 3 62
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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