Delphi isolate functions and procedures to different file

Posted on 2003-03-26
Medium Priority
Last Modified: 2011-09-20
Hi everyone
               i have written a application on delphi The problem is that the number of lines of my code is more than 5300, so i have desided to isolate the main functions to a different file , i know there is a way to do it by creating files and adding it in the uses claws > can u please tell me how to do this , im just new to delphi
Question by:samuel_chinnu123
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

Expert Comment

ID: 8215507
in File Menu, Click Add, and Select unit: then you will get an empty unit template:

unit Unit2;




- Save this unit
- in implementation write all procedures and functions you need
- in Interface section, write all procedure/function headers that you want other units to access it:

unit Test


function Sum(a, b: Integer): Integer;


function Sum(a, b: Integer): Integer;
  Result:= A + B;


- Alos you can put all global variables and types you want others to see it in Interface section:

  TRec = record
    name: string;
    DOB: TDateTime;
  state: Integer;

to call that function from other units, go to File/Add Unit and select that unit name

then you can call any procedure and function on that unit the same you do to local function/procedure


Accepted Solution

sammy_chinnu earned 240 total points
ID: 8222317

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 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