Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Two packages have the same unit name


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Dec 5, 2016 12:37 AM Last Post By: Clement Lee
Clement Lee

Posts: 5
Registered: 8/27/11
Two packages have the same unit name  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2016 8:03 PM
Hi,

How to ensure my application is using the correct unit?

For example,
PackageA has a UnitX.
PackageB has a UnitX.

In my program, I need to add the UnitX in my Uses clause.

unit UnitMyProgram
interface

uses
System.SysUtils, UnitX;
.
.
.

var
MyProgram: TMyProgram;
objUnitX : TUnitX;


Thank You.

Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Two packages have the same unit name  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2016 11:44 PM   in response to: Clement Lee in response to: Clement Lee
Clement Lee wrote:

Hi,

How to ensure my application is using the correct unit?

For example,
PackageA has a UnitX.
PackageB has a UnitX.

That is an absolute no-no if you build your project with run-time
packages. You can only get around it if you have the full source and
can rebuild one of the packages, so you can change the offending unit
name. Using unit names with namespace prefixes can reduce the chance of
such collisions, but of course you have no control over the names used
in 3rd-party packages...

--
Peter Below
TeamB

Clement Lee

Posts: 5
Registered: 8/27/11
Re: Two packages have the same unit name  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 5, 2016 12:37 AM   in response to: Peter Below in response to: Peter Below
Peter Below wrote:
Using unit names with namespace prefixes can reduce the chance of
such collisions, but of course you have no control over the names used
in 3rd-party packages...

Thanks a lot.

Edited by: Clement Lee on Dec 5, 2016 12:37 AM

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02