Solved

Prevent Circular unit reference

Posted on 2006-07-10
5
287 Views
Last Modified: 2010-04-05
How do I prevent Circular unit reference to 'MyUnitU' ?
0
Comment
Question by:crystyan
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
atul_parmar earned 250 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
select query - oracle 16 100
Firemonkey webbrowser scrollbars ? 1 37
Delphi and Access based Enumeration 9 59
can i put an image from resource into image tag ? 6 24
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now