Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6980015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:57:35+00:00 2026-05-27T17:57:35+00:00

How do I create a unit in order to call it after that by

  • 0

How do I create a unit in order to call it after that by adding it to the uses clause of the implementation part of 3 other units?

When I first create a unit I see something like:

unit Unit1;

interface

implementation

end.

How do I put some variables which I am using in my script in order to re-call them from 3 other units (to avoid circular references)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:57:36+00:00Added an answer on May 27, 2026 at 5:57 pm

    Global variables, classes, methods, constants, and public members defined in the Interface section are all available to reference in other units.

    unit Unit1;
    
    interface
    
    const
      // Global constant
      MY_CONSTANT = 'FOO';
    
    type TMyObject = class
    private
      FMyProperty: String;
    public
      // Public instance variable of class TMyObject
      myPublicInstanceVariable: String;
      // Public property of class TMyObject
      property MyProperty: String read FMyProperty;
    end;
    
    var
      // Global variable
      myStringVariable: String;
    
    implementation
    
    end.
    

    Protected members are available from other units within an inherited class.

    Unfortunately, the documentation in XE2 is rather sparse. If you had an earlier version of Delphi, everything you needed to know about the basics would be included in the online help.

    Edit

    My answer to this question gives more details about uses clauses and avoiding circular references:

    How to manage circular references in delphi units?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a unit test for a method that takes a
The fundamental question is how do I create a unit test that needs to
I've created a data builder in order to create test data in my unit
I want to create unit tests for one of my project's classes but I'm
Should one create unit tests involving IO? Ie, testing a class method for serializing/deserializing
Visual Studio 2008 has the ability to automatically create unit test stubs. I have
I want to create a unit test for integration testing. What class should I
I'm trying to create a unit test to test the case for when the
I am trying to create a unit test similar to how I would have
I have some kind of test data and want to create a unit test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.