Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Prevent Circular unit reference

Posted on 2006-07-10
5
Medium Priority
?
300 Views
Last Modified: 2010-04-05
How do I prevent Circular unit reference to 'MyUnitU' ?
0
Comment
Question by:crystyan
[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
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
atul_parmar earned 1000 total points
ID: 17072448
move either units from interface section to implementation section.
e.g.

interface
uses MyUnitU -->>> Move from here

implementation
uses MyUnitU  ->>> to here
0
 

Author Comment

by:crystyan
ID: 17072465
then how do I declare a variable that is defined in MyUnitU ?
0
 
LVL 10

Expert Comment

by:atul_parmar
ID: 17072504
Moving a unit from interface section to implementation section doesn't affect any other code. you can define /use variables the same way.

Can you clarify what exactly you want to do?
0
 

Author Comment

by:crystyan
ID: 17072514
I have the main unit, then I`m creating a class where I want to declare a variable of a type that is defined in the main unit. or let`s say use a constant from the main unit.
0
 
LVL 10

Expert Comment

by:atul_parmar
ID: 17072548
unit MainUnit

const
  MyConst = 1000;


unit MySubUnit

interface
  procedure MyProc;

implementation
procedure MyProc;
MyVar : Integer;
begin
  MyVar := MyConst;
 
end;
 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

670 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