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 6090895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:15:57+00:00 2026-05-23T12:15:57+00:00

Using Delphi 2010… I have a set of binary properties I want to group

  • 0

Using Delphi 2010…
I have a set of binary properties I want to group together. I have defined it as such…

type
    TTableAttributeType = (
        tabROOT = 1, 
        tabONLINE = 2, 
        tabPARTITIONED = 3, 
        tabCOMPRESSED = 4,  
        );

// Make a set of of the Table Attribute types...
type
      TTableAttrSet = Set of TTableAttributeType;

In my MAIN.PAS unit, I can create a variable of type TTableAttrSet.
Another Unit, UTILS.PAS needs to understand the TTableAttrSet type as well. That is taken care of by the USES clauses…

Main USES Util…
Util USES Main (The 2nd uses clauses, under implementation section, so I don’t get circular reference problems….

So far so good. My problem is that I need to pass a var variable of type TTableAttrSet FROM main to Utils.

In main.pas

procedure TForm1.Button1Click(Sender: TObject);
    var
    TabAttr : TTableAttrSet;

    begin
    TestAttr (TabAttr);
    end;

and in UTILS.PAS, I have

procedure TestAttr(var Attr: TTableAttrSet);
begin
      Attr := [tabROOT, tabCOMPRESSED];
end;

When I try this, I run into several problems…
Problem 1). When I define my procedure definition at the top of utils.pas,

procedure TestAttr(var Attr: TTableAttrSet);

I get the error that TTableAttrSet is an Undeclared Identifier. This makes sense because the definition is in Main.pas, and the ‘uses Main.pas’ is AFTER my procedure definitions. How do I get around this? For now, I have duplicated the TTableAttrSet type definition at the top of the Utils.pas file as well as Main.pas, but this does not ‘seem the right way’.

Problem 2). The bigger issue that I am running into is a compile error. on the calling line in Main.pas

TestAttr(TabAttr);

I get the error ‘Types of actual and formal var parameters must be identifical’. To my knowledge they are identical. What is the compiler complaining about?

  • 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-23T12:15:58+00:00Added an answer on May 23, 2026 at 12:15 pm

    The simple solution is to move the declaration of TTableAttributeType to the Utils unit. You can’t declare it twice because then you have two distinct types. That’s no use to you, you need only a single type.

    This solution will work so long as the Main unit does not need to reference TTableAttributeType in its interface section. Since the Utils unit clearly needs to do so then that would create a circular dependency between unit interface sections which is illegal.

    If both the Main and Utils units need to reference TTableAttributeType in their interface sections then you need to create another unit that just contains type declarations. That unit could be used by both Utils and Main in their interface sections.

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

Sidebar

Related Questions

I am using Delphi 2010. I have to set UseLatestCommonDialogs to False and additionally
I have started using of generics in Delphi 2010 but I have a problem
I am using Delphi 7 but I have trialed the Delphi 2005 - 2010
I'm using Delphi 2010 and I have a TToolButton contained by a TToolBar. Assigned
I am using Delphi 2010 with Tim Anderson's SQLite wrapper (unicode version) Have a
Using Delphi 2010, I have used TSQLQuery and TSQLConnection to connect to a remote
I'm automating some document creation using Delphi 2010. In the layout I have, I
I am using Delphi 2010 and I have a need to be able to
Using Delphi 2010 and a patched version of the BDE I run into a
Is there a way (on windows using Delphi 2010) to get the number of

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.